Race condition when recovering delayed action executions (executions get stuck in "delayed" status)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6.5k
- Forks
- 787
- PR merge metrics
- No merged PRs in 30d
Description
Today I noticed a race condition with re-scheduleing of delayed action executions on the build server (delayed -> requested).
The problem appears to be that live action and corresponding action execution database objects are not updated atomically together (aka as part of a transaction). Because of that, if for some reason process is interrupted and only live action is updated, but not the corresponding action execution is not, those executions will get stuck in the limbo and won't proceed with execution (live actions will have a status of requested and action executions will have a status of delayed).
The only way to get out of those limbos and those executions in-stuck is to cancel and re-run them (this will of course only work if those actions are idempotent).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files, tests, or entry points are named. Start by locating the delayed-action recovery and rescheduling flow, then trace how live actions and action executions are persisted; done means interrupted recovery cannot leave them with mismatched statuses, with a regression test covering the failure case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100