fix(scheduler): persist terminal job state before cache eviction - #2037
Merged
andygrove merged 1 commit intoJul 15, 2026
Merged
Conversation
lukekim
approved these changes
Jul 14, 2026
milenkovicm
reviewed
Jul 14, 2026
milenkovicm
left a comment
Contributor
There was a problem hiding this comment.
thanks @phillipleblanc i think this make sense, one comment, should we do retry as part of job state implementation rather than part of task manager? to me it looks like retry ability is implementation specific ? wdyt ?
Keep successful and aborted jobs in the active cache until terminal-state persistence completes, preventing status readers from observing stale state. Snapshot graphs before asynchronous work so graph locks are not held across persistence. Leave retry policy to JobState implementations because generic saves are not guaranteed to be idempotent. Exclude terminal entries from running-job metrics and evict after a failed save so shared state remains authoritative. Dispatch executor task cancellation before abort persistence so save failures cannot suppress cancellation. Add deterministic coverage for success, save failure, lock availability, metrics, and abort cancellation when persistence fails.
phillipleblanc
force-pushed
the
phillip/upstream-terminal-status-order
branch
from
July 15, 2026 01:58
df258a8 to
610b4c1
Compare
milenkovicm
approved these changes
Jul 15, 2026
Contributor
|
Thanks @phillipleblanc & @lukekim |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #2036
Rationale for this change
Terminal jobs were removed from the scheduler's active cache before their final state was saved. During that window, status requests could fall back to shared state and incorrectly report the job as
Running.Abort handling had a related failure mode. If terminal-state persistence failed,
abort_jobreturned before dispatching cancellation for running executor tasks.This PR keeps terminal jobs visible in the active cache until persistence finishes. It applies the same ordering to successful, failed, and cancelled jobs.
What changes are included in this PR?
Runningjobs in the running-job metric.Are there any user-facing changes?
No