Skip to content

Release concurrency locks when supervisor fails the jobs handled by workers #547

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

Merged
merged 2 commits into from
Apr 18, 2025

Conversation

nerisa
Copy link
Contributor

@nerisa nerisa commented Apr 8, 2025

When workers 'die' because of various reasons, the supervisor unlocks the jobs that were being handled by those workers by deleting the claimed_executions for the job and creating failed_executions. However, it does not release any concurrency locks taken by the jobs. This can be an issue if the concurrency limit was reached for the job because no further jobs can run until the concurrency duration is reached.

In this PR, I call job.unblock_next_blocked_job when the supervisor releases all claimed executions of the worker.

Fixes #546

@nerisa nerisa marked this pull request as ready for review April 9, 2025 20:41
@nerisa
Copy link
Contributor Author

nerisa commented Apr 9, 2025

I couldnt figure out why test/integration/processes_lifecycle_test.rb:171 fails. If I run the test file independently, it passes but when I run the whole test suite, I get the same error as in the CI.

Copy link
Member

@rosa rosa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @nerisa, thanks a lot for submitting this PR and sorry for the delay! This looks great. I think the failure is due to that test being flaky in some circumstances. I've got it pending to make them completely stable 😳

@rosa rosa merged commit 95dc9b4 into rails:main Apr 18, 2025
34 checks passed
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.

When the worker dies, the concurrency limit is not reset
2 participants