Skip to content

Stop workers when job finalization fails - #768

Open
rafael-pissardo wants to merge 1 commit into
rails:mainfrom
rafael-pissardo:fix/748-claimed-execution-stuck-on-finished-failure
Open

Stop workers when job finalization fails#768
rafael-pissardo wants to merge 1 commit into
rails:mainfrom
rafael-pissardo:fix/748-claimed-execution-stuck-on-finished-failure

Conversation

@rafael-pissardo

@rafael-pissardo rafael-pissardo commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • wrap finalization failures while a claimed execution is still present in a dedicated error
  • stop the owning worker after that unrecoverable error so shutdown releases the claim for retry
  • keep workers running after ordinary job failures and avoid joining from a pool thread

Fixes #748.

Test plan

  • TARGET_DB=sqlite bundle exec ruby -Itest test/unit/worker_test.rb
  • TARGET_DB=sqlite bundle exec ruby -Itest test/models/solid_queue/claimed_execution_test.rb
  • TARGET_DB=sqlite bundle exec ruby -Itest test/integration/jobs_lifecycle_test.rb
  • RuboCop on changed Ruby files

@rafael-pissardo
rafael-pissardo force-pushed the fix/748-claimed-execution-stuck-on-finished-failure branch from 249f2ec to db4a139 Compare July 24, 2026 20:03
Prevent claimed executions from remaining stuck after transient database errors by terminating the owning worker so shutdown releases the claim.
@rafael-pissardo
rafael-pissardo force-pushed the fix/748-claimed-execution-stuck-on-finished-failure branch from db4a139 to d903a36 Compare July 24, 2026 20:03
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.

ClaimedExecution can be stuck in claimed state forever when #finished raises

1 participant