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

Release any orphaned claimed executions as part of the process prune #244

Merged
merged 1 commit into from
Jun 25, 2024

Conversation

rosa
Copy link
Member

@rosa rosa commented Jun 24, 2024

Orphaned executions shouldn't happen as part of regular operation, but some people have reported them (#159). The only way I can think of this happening could be that a worker gets deregistered while still working normally so that it happens to be claiming executions while the process record is deleted. This means that the callback to release claimed executions might not yet see the executions that are being claimed at the same time, and as such, it won't release any. Or, in other words, those executions would get claimed by a process that's getting deleted and that once they're committed to the DB, it no longer exists.

To recover from this scenario, as well as checking for processes with an expired heartbeat, the supervisor will also check for orphaned executions and release them.

Orphaned executions shouldn't happen as part of regular operation but
some people have reported them. The only way I can think of this
happening could be that a worker gets deregistered while still working
normally, so that it happens to be claiming executions while the process
record is deleted. This means that the callback to release claimed
executions might not see yet the executions that are being claimed at
the same time, and as such, it won't release any. Or, in other words,
those executions would get claimed by a process that's getting deleted
and that once they're committed to the DB, it no longer exists.

To recover from this scenario, as well as checking for processes with an
expired heartbeat, the supervisor will also check for orphaned
executions and release them.
@rosa rosa merged commit 5d722f8 into main Jun 25, 2024
8 checks passed
@rosa rosa deleted the improve-dead-worker-cleanup branch June 25, 2024 08:22
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