fix: jobs can remain permanently active if final status persistence fails after three short retries#874
Closed
sam-saffron-jarvis wants to merge 1 commit into
Closed
Conversation
…ails after three short retries
Owner
|
Implemented in local copy: jobs v2 final run persistence now retries for a bounded 30s window with exponential backoff and exits early during shutdown. Verified with go build ./... and targeted tests. |
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.
What changed
finishRunWithRetryincmd/serve_jobs_v2.goto retry final run persistence for up to 30 seconds instead of only 3 short attempts.Why this is high-value
A run only leaves
queued/claimed/runningthrough final status persistence. Before this change, a brief burst of SQLite write failures at completion time could leave a run non-terminal forever until process restart. That could permanently consume concurrency slots and block future job executions, especially for single-run orforbidjobs.This change keeps terminalization durable across transient DB write failures, preventing a single short-lived persistence error from wedging the job pipeline.
Validation
gofmt -w cmd/serve_jobs_v2.go cmd/serve_jobs_v2_test.gogo build ./...go test ./...TestJobsV2ExecuteRunRetriesFinishRunAfterTransientDBLockpasses with a lock duration that exceeds the old retry budget.