You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(job): honor authored retryPolicy/timeout in the job scheduler (#3494)
JobSchema.retryPolicy and JobSchema.timeout were parsed-but-ignored (the
2026-06 liveness audit's aspirational-config cluster). Built rather than
pruned:
- spec: IJobService.schedule gains an optional 4th options argument
(JobScheduleOptions with retryPolicy/timeout + JobRetryPolicy type);
backward compatible. JobSchema describe strings updated (EXPERIMENTAL
markers removed).
- service-job: new runWithPolicy helper (+ JobTimeoutError) wraps handler
invocation in CronJobAdapter and IntervalJobAdapter; DbJobAdapter threads
options through. Failed attempts (incl. timeouts) retry with exponential
backoff up to maxRetries; over-limit attempts record execution status
'timeout'. No options = legacy single-attempt behavior (guarded by test).
- runtime: AppPlugin declarative-jobs registration forwards the authored
retryPolicy/timeout.
Tests were written first and verified red on the old adapters (handler
called once, no timeout status), then green on the implementation.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|**handler**|`string`| ✅ | Handler function name (must match a key in `defineStack({ functions })`) |
65
-
|**retryPolicy**|`{ maxRetries?: integer; backoffMs?: integer; backoffMultiplier?: number }`| optional | Retry policy configuration. [EXPERIMENTAL — not enforced] The service-job scheduler does not yet read retryPolicy; failed runs are not retried per this config (liveness audit #1878/#1893). |
66
-
|**timeout**|`integer`| optional |Timeout in milliseconds. [EXPERIMENTAL — not enforced]The service-job scheduler does not yet enforce a per-run timeout (liveness audit #1878/#1893). |
65
+
|**retryPolicy**|`{ maxRetries?: integer; backoffMs?: integer; backoffMultiplier?: number }`| optional | Retry policy: failed runs (including timeouts) are retried with exponential backoff (delay = backoffMs * backoffMultiplier^(retry-1)) up to maxRetries retries after the initial attempt (#3494). Omit for the legacy single-attempt behavior. |
66
+
|**timeout**|`integer`| optional |Per-attempt time limit in milliseconds; an over-limit run is recorded with execution status "timeout" (#3494). The in-flight handler is abandoned, not forcibly cancelled. Omit for no time limit. |
67
67
|**enabled**|`boolean`| optional | Whether the job is enabled |
0 commit comments