Repository navigation
Description
An independent read of the last two rounds of #16475 (commits 7f524f7..e5af891, read after the merge) found one new gap, two failure paths the new back-off does not cover, and contract text that overstates the code. No finding lets two sessions hold one item. Line numbers are at e5af891, under plugins/work-items/tools/work-item-tracker/.
Findings
- A holder can end unassigned (three sessions on one login).
adapters/github/common.sh:519-521: the hand-back's last removal has no re-list after it. Session X releases and removes the login; Z posts a lease, so X's re-list re-adds the login; Z's lease ends; X's third list shows no live lease and X pauses 1 s before its DELETE; H claims and wins inside that pause; X's DELETE lands. H holds a live lease with nobody assigned, solist-frontieroffers the item and each later claimant posts a lease, loses and backs off. No fixed sequence of removals and re-adds closes this without compare-and-swap;CONTRACT.md:752-754says one session always sees the other's write, which is not true here. - A renew PATCH that GitHub applies but reports as failed skips the back-off.
adapters/github/renew-lease.sh:87:wit_patch_lease_commentexits throughwit_run_ghbefore the after-expiry check, so a lease revived after its expiry is kept. - Renew's back-off hands back even when its supersede failed.
adapters/github/renew-lease.sh:91-92: the lease is still live, the login is removed, and the lease blocks the item for its TTL. - Contract drift.
CONTRACT.md:754(finding 1);:817-818say a list failing twice makes the rollback remove the assignee, but the re-list atcommon.sh:513-516can put it back;:772-779say every exit-0 release hands back, butrelease.sh:79-83exits 0 with no hand-back for another login's already-superseded lease. - Test gaps in
adapters/github/lease-coordination.test.sh: no case for finding 1's race; the after-expiry back-off has no case where a same-login winner keeps the login.
Done when
-
CONTRACT.md"Lease protocol" states finding 1 as a known limit (a holder left unassigned; the lease still excludes other workers) and no longer claims one session always sees the other's write. -
renew-lease.shruns the back-off when its PATCH fails and the clock is at or past the old expiry or within the 300 s margin, with a test that fails before the change. - Renew's back-off retries its supersede once and hands the assignee back only when a supersede succeeded, with a test that fails before the change.
-
CONTRACT.mdlines for the rollback after a failed list and for release's exit-0 paths say what the code does. -
lease-coordination.test.shhas the after-expiry back-off case where a same-login winner keeps the login.
Not asked for: a code change for finding 1. Basis for leaving it as a stated limit: the lease still gives one holder (model check on #16475), the cost is wasted claim attempts, and the alternatives each add a part (a fourth list and re-add narrows the window without closing it; having renew re-assert the assignee needs a new lease field to tell a default claim from a lease-only one).
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Work status
needs-triage
Priority
medium
Activity
github-actions commentedon Nov 16, 2026
Size: Medium
Complexity: Medium
Uncertainty: Known
Flags: none
Blocked by: none
I read this as follow-up work after #16475, which is already merged. It covers two gaps in renew's back-off in the GitHub adapter. It also asks for contract wording that matches the code, and for tests of those cases. The race in finding 1 is to be documented as a known limit, not fixed, and the five done-when items are specific enough to act on.
I found no open duplicate and no merged pull request that already covers these items.
Automated triage. A maintainer reviews it.
melodic-automation-lanes commentedon Nov 16, 2026
{"v":1,"actor_id":337595936,"title_sha256":"57b923bad58b13340fbe2ded5080a24826bf83b8b056cd9cf7a5c986ac300b56","body_sha256":"522fa847d8a077114262a49728a6345977c1078db314e4af25abe3f53fc33f86"}
github-actions commentedon Nov 16, 2026
fix(work-items): hand back on an outranked release only after its sup…