Skip to content

Dequeue atomic#290

Open
AlbertoCasasOrtiz wants to merge 6 commits into
devfrom
dequeue-atomic
Open

Dequeue atomic#290
AlbertoCasasOrtiz wants to merge 6 commits into
devfrom
dequeue-atomic

Conversation

@AlbertoCasasOrtiz

Copy link
Copy Markdown
Member

Fixes #267.

Most changes are due to indentation. Real changes are the addition of atomic to make everything a single transaction:

with transaction.atomic():

Select for update, which locks the trial so other workers cannot modify or lock them. If already locked by another worker, it skips it.

.select_for_update(skip_locked=True)

And a status check that, if for any reason a worker gets a trial already locked and in a non-available status, will skip it:

if trial.status not in ["stopped", "reprocess"]:
    raise Http404

@AlbertoCasasOrtiz AlbertoCasasOrtiz changed the title WIP - Dequeue atomic Dequeue atomic Jun 30, 2026
@AlbertoCasasOrtiz

Copy link
Copy Markdown
Member Author

@carmichaelong I just fixed conflicts on this branch

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.

1 participant