Skip to content

rex.job: fix a race condition in transitioning a job from "new" to… #45

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

Open
wants to merge 1 commit into
base: baseline/master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/rex.job/src/rex/job/workers/job_queuer.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@
))
'''

# Note that we only change the status to queued if it is still new.
# This is to avoid a race condition where the job may already be completed/failed.
HTSQL_UPDATE_NEW = '''
/job[$job]{
/job[$job].filter(status='new'){
id(),
'queued' :as status,
}
Expand Down