Move scheduling and cancelation db operation to atomic update requests - #104
Merged
Merged
Conversation
badtst
marked this pull request as ready for review
September 3, 2026 16:09
Comment on lines
+154
to
+155
| (rather than on a fixed call count) keeps this test working regardless | ||
| of how many reads a strategy's candidate pick does. |
Collaborator
There was a problem hiding this comment.
nit: Can we get rid of these chain of thoughts statement which are just remnant from debugging? Let's focus on what has been implemented and why
MatthieuMoreau0
approved these changes
Sep 7, 2026
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.
Description
Use atomic
UPDATEstatements for job cancellation/job scheduling instead ofWITH FOR UPDATEstatements which are noop on sqlite.Atomic update statements are preffered to other solutions like exlusive transactions as they have a reliable behavior across the different backends and the logic performed within them is actually quite simple.
Improved testing for those possible race conditions:
Changed
get_next_jobinterface tries to claim the job by settingscheduled_atdatetime of the previously identified job id