Repository navigation
Conversation
touch() only checked that the job existed. After the stale sweep re-queued a job, the original worker's heartbeat still succeeded: it stamped heartbeat_at on a QUEUED job and HeartbeatManager kept beating, so the worker never learned it had lost the claim while another worker could pick the job up. BrokerQueue hits this by timing alone, since each batch sweeps stale jobs before applying the heartbeats in that batch. Raise the new JobNotInProgressError from touch() when the job is not IN_PROGRESS, leaving state unchanged, and stop HeartbeatManager on it.
This branch has not been deployed
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.
Stack 2/9, base #3.
touch()accepted a job already re-queued as stale, so the worker never learned it lost the claim. Now raises the newJobNotInProgressError, andHeartbeatManagerstops on it.Behaviour change:
heartbeat()on a non-IN_PROGRESS job raises.Tests:
test_touch_queued_job_raises_and_leaves_state_unchanged,test_touch_after_stale_requeue_raises,test_heartbeat_after_stale_requeue_raises,test_heartbeat_swept_in_same_batch_raises,test_heartbeat_stops_after_real_stale_requeuefail on base;test_touch_updates_heartbeatand existing heartbeat tests pass on both.