Skip to content

fix: retain ready runner during brief claim contention - #152

Merged
lweberru merged 1 commit into
mainfrom
fix/runner-pool-claim-contention
Oct 24, 2026
Merged

lweberru merged 1 commit into
mainfrom
fix/runner-pool-claim-contention

Conversation

@lweberru

@lweberru lweberru commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

A readiness heartbeat can briefly lock the only ready Runner. The reservation uses SKIP LOCKED, so it previously took the cold path immediately even though the standby remained eligible. This also makes a prepared hosted recovery drill miss its intended Runner.

Retry an empty reservation up to four times, 50 ms apart, only while a fresh candidate remains visible in the same source-bound pool. Successful reservations, assignment callbacks, database errors and ambiguous outcomes are never replayed. Missing, stale, assigned or persistently locked reserves retain the cold fallback. Public English/German execution documentation describes the bound.

Validation:

  • New real-PostgreSQL lock test fails against the previous code and passes with the fix.
  • All 15 Runner-pool database tests pass, including persistent contention and concurrent ownership.
  • All 63 platform database tests pass.
  • Complete npm run check: build/typecheck/lint and 1,060 tests pass; 74 existing optional tests skipped in that command (targeted database checks run separately). Existing lint warnings remain.

Refs #95. The hosted interruption and subsequent recovery remain unqualified; the observed live fallback is consistent with contention, but its transient lock was not captured. No customer Apply or state modification is part of this PR.

@lweberru
lweberru merged commit d282216 into main Oct 24, 2026
14 checks passed
@lweberru
lweberru deleted the fix/runner-pool-claim-contention branch October 24, 2026 11:59
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.

1 participant