Repository navigation
Requeue interrupted jobs instead of leaving them stuck running - #260
Merged
Merged
Conversation
On shutdown (SIGTERM from deploys) the runner now traps exits and its terminate kills in-flight tasks and puts their jobs back at the front of the queue, instead of leaving the rows in running until the maintenance sweep fails them three hours later. Agents report the requeue to the master over a new /api/queue/requeue endpoint. The maintenance sweep likewise requeues stale running jobs - a job stuck for three hours means its node died hard, not that the work is suspect - capped at two requeues before it is marked failed. Requeueing records no backoff and keeps inserted_at, so interrupted jobs resume promptly. A crashing task (throw/exit) no longer takes the runner down with it; the abnormal DOWN now marks that job failed and the runner keeps its bookkeeping for the other running jobs.
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.
On shutdown (SIGTERM from deploys) the runner now traps exits and its terminate kills in-flight tasks and puts their jobs back at the front of the queue, instead of leaving the rows in running until the maintenance sweep fails them three hours later. Agents report the requeue to the master over a new /api/queue/requeue endpoint.
The maintenance sweep likewise requeues stale running jobs - a job stuck for three hours means its node died hard, not that the work is suspect - capped at two requeues before it is marked failed. Requeueing records no backoff and keeps inserted_at, so interrupted jobs resume promptly.
A crashing task (throw/exit) no longer takes the runner down with it; the abnormal DOWN now marks that job failed and the runner keeps its bookkeeping for the other running jobs.