Reserve recovery workers and cancel obsolete gate waits - #204
Merged
Merged
Conversation
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.
Canceled automatic recovery could remain blocked on a unit gate held by a newer operation. Recovery now uses its accepted cancellation context while acquiring the gate, so obsolete waits exit before that newer native operation finishes. Initial launch failures also reserve recovery before spawning; duplicate requests create no worker. The accepted recovery record carries its exact invocation owner into the worker.
The strengthened existing regression fails on previous main after a newer failed explicit launch cancels recovery while retaining the gate. Twenty repetitions of the recovery identity/backoff matrix pass with the fix. Full uncached race tests passed (manager 60.287s, journal 41.968s), plus vet, Windows/Linux staticcheck, documentation links and complete diff/privacy review.
Exact source
6591e9ac16f49a8c1a96bd68a19c5c433db4564apassed CI 34767502672 and eight cases ten times per SYSTEM/headless standard-user identity (9.957s/9.123s), including genuine native restart/backoff and invocation identity. No cases skipped; fixture processes, linger and profile ownership were fully cleaned up, and binary/source identity verified in retained evidence. Full R2 writer and worker-class acceptance remains open.