Confine claim recovery to the worker loop and fence shared claims - #117
Merged
Merged
Conversation
PhiLily
force-pushed
the
fix/claim-recovery-scope
branch
from
September 28, 2026 08:23
f2068c0 to
50e5cef
Compare
Narrow and complete the unreleased recovery work on main. Recover unconfirmed claims only in Worker.run() on PostgreSQL with psycopg 3, MySQL and SQLite. Restore run_once() and testing.run_tasks() to 1.6.0 behavior on claim errors, and exclude psycopg2 from recovery. Fence recovery against concurrent claims without holding a lock across a claim or a database call. Track claims through registration, including subclass work after the base claim returns. Keep shared Worker claims concurrent and defer recovery when a claim is in flight. Give a Worker inherited across a fork a new child id, empty claim bookkeeping and fresh locks. Retain the slot suffix and document the inherited heartbeat path and unsupported claimed-row handoff. Complete stop-time recovery limits, stable recovery log events and documentation. A recovery error does not prevent shutdown; the recovery waiting limits do not bound shutdown as a whole. Tests cover each behavior the fix changes.
PhiLily
force-pushed
the
fix/claim-recovery-scope
branch
from
September 28, 2026 09:08
50e5cef to
f4f2ae3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Worker.run()on PostgreSQL with psycopg 3, MySQL and SQLite; restoreWorker.run_once()andtesting.run_tasks()to 1.6.0 behavior on claim errors and exclude psycopg2. Fence recovery against concurrent claims through returned-row registration, including subclass work, without holding a lock across a claim or a database call. Shared-Worker claims remain concurrent. Give a Worker inherited across a fork a new child id and fresh bookkeeping so recovery cannot release the other process's running task. Document fork restrictions, recovery limits, stop-time waiting and stable log events. No database migration is required.run_once()andtesting.run_tasks()match 1.6.0 statement for statement across 49 scenarios.