Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete ready_executions only when they've been claimed #31

Merged
merged 3 commits into from
Oct 30, 2023

Conversation

rosa
Copy link
Member

@rosa rosa commented Oct 30, 2023

If we try to claim a set of job IDs, creating claimed executions for them, but for some reason, we fail to do that for some of them, in a way that the failure is ignored (e.g. on a duplicate key conflict that gets ignored with Rails's insert_all), we'd be deleting the ready execution for these, even if they weren't claimed at all, leaving the job in limbo. This change simplifies a bit the claiming code and ensures only those jobs that have been claimed are indeed deleted.

This also adds NOT NULL constraints to job_id columns, that I had missed.

If we try to claim a set of job IDs, creating claimed executions for them,
but for some reason, we fail to do that for some of them, in a way that the
failure is ignored (eg. on a duplicate key conflict that gets ignored with
Rails's `insert_all`), we'd be deleting the ready execution for these, even
if they weren't claimed at all, leaving the job in limbo. This change simplifies
a bit the claiming code and ensures only those jobs that have been claimed are
indeed deleted.
@rosa rosa merged commit 9cd9971 into main Oct 30, 2023
2 checks passed
@rosa rosa deleted the ensure-only-claimed-jobs-are-deleted branch October 30, 2023 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants