fix: the transition map carries the lease-expiry sweep's running-to-pending edge; the ordering docs name the cross-actor rotation - #310
Merged
Conversation
…nning-to-pending edge, and the ordering docs name the cross-actor rotation that cuts a dispatch round
…ons any transitive importer, and the root conftest's import of the fixture module died at collection in the single-extra legs that install no fastapi (the modules gate themselves, the three the SSO round added now do too); the state-machine pins carry the sweep's running-to-pending arc the map now encodes
…s: the interrupted claim spends the attempt (refund would re-create the epoch the interrupted handler still holds), so the drain releases pending with the increment standing and a deploy costs one attempt of budget
…re identifiers it false-positives on
…il the org's larger-runner labels exist: the pinned labels matched no runner and queued those legs forever
…act: deferral arms refuse a row carrying a cancel phase (the cancel ladder finishes it), mark_failed_or_retry still clears the slate for the next attempt, and an interrupted claim spends the attempt
…: it saturates one containerized Postgres from every pool dimension on two-second command budgets, and a parallel-lane neighbor's load is indistinguishable from the hang it exists to catch
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.
Closes #304
Closes #305
What
Two consistency fixes surfaced by downstream consumers building checkers against our public contracts. Neither changes runtime behaviour.
The transition map (
VALID_TRANSITIONS)The map describes itself as the canonical encoding of the job state machine, and its convention is to include every authorized transition, annotating the sweep-only ones (the
pendingandscheduledentries already do this for the deadline-exceeded sweep). Therunningentry was missingpending: the lease-expiry and heartbeat-timeout sweeps send a reclaimed running job back to pending whenever attempts remain, and record the state change withfrom_state=running,reason=lock_expired.assert_valid_transitionnever gated the sweep, so no behaviour was wrong, but anyone consulting the exported map to learn which transitions TaskQ can emit would conclude this one cannot happen. It happens on every lease expiry. The edge is added with the same annotation convention, and pinned.The ordering docs
The mode table gave
strict_fifoaspriority DESC, scheduled_at, idand called it a simple priority queue. That ordering holds within one actor; across actors sharing a queue, the round'seligiblecut orders bypending_rankfirst, so each eligible actor's rank-1 job admits before any actor's rank-2 (the deliberate anti-starvation rotation, stamped viaactor_claimed_at). The table now says which ordering it means, and the CTE walkthrough'seligibleline now carries the ORDER BY every other stage already shows.Verification
Red-green: the map pin failed before the fix and passes after (the transition families: 89 passed); lint clean; pyright 0 errors.
Followup: the shutdown e2e pins carry the merged interrupt semantics
The e2e lane's first run on this branch exposed three pins still asserting the pre-#300 refund contract that this PR's sibling fix (#300, merged) replaced: the SIGTERM drain's release predicate demanded `attempt == 0` and the watchdog-trip and replacement-worker pins asserted the un-spent increment. The merged contract spends the interrupted claim's attempt (refund would re-create the attempt epoch the interrupted handler still holds). The pins now assert the merged semantics: the drain releases `pending` with the increment standing, the watchdog trip releases held with it standing, and a deploy costs one attempt of budget. Verified locally against main's code before the push: the five shutdown-family e2e tests green.