Held-checkout archiving holds the claim-ownership lock and starves ownership checks for minutes
I maintainer di solito rispondono entro 1 giorno
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Problem
retireHeldCheckout() in server/services/heldCheckoutRecovery.js runs archiveCheckout() — a full byte-preserving archive of the checkout (tracked, untracked, ignored files and Git administration) — inside withClaimOwnershipLock. That lock is the single process-wide queue behind every claim-ownership check/reserve/bind/release (ownershipTransaction in server/services/cosClaimOwnership.js), whose callers give up after CLAIM_OWNERSHIP_QUEUE_TIMEOUT_MS (15 s) with ownership-queue-timeout.
When the deterministic held-checkout recovery retires several checkouts back to back, the queue is starved for many minutes. Every ownership check during that window is refused.
Evidence (redacted, one incident on 2026-10-20)
- The last
🔒 Claim ownership … status=settledline came at about 18:14 UTC. After that, everyreserveloggedstatus=queue-timeout phase=ownershipQueue ownershipQueueMs≈15000, with nopending/startedoperation, until the first admission at 18:32 UTC: ~18 minutes. - In the same window:
🧹 held-checkout recovery: retired …claim-…-issue-12569(18:26),…issue-12573(18:28). - Effect: three concurrent branch-reconcile sub-agents each got
admitted:falsefor 10+ minutes on PRs that were green and CLEAN. One of them gave up and merged without a successful recheck (a protocol breach the gate is meant to prevent). The other was held until the queue cleared.
Expected vs actual
- Expected: an ownership check queues behind at most one short critical section (fresh owner read, compare, persist), as the 15 s budget assumes.
- Actual: it queues behind arbitrarily long archive I/O for N checkouts in sequence.
Chosen fix
Do the archive outside the claim-ownership lock and keep only the fences inside it:
- Under the lock:
matchReleaseplus owner/inventory/review checks. Then take a per-checkout retirement reservation (the existingwithCheckoutPublication/CHECKOUT_RETIREMENT_RESERVEDadmission inserver/lib/checkoutRetirementAdmission.js) so no claim can bind that checkout while it is being archived. Release the global lock. - Without the global lock:
archiveCheckout(). - Re-take the lock for the existing second
matchRelease→verifyRemoval(administration and content fingerprints) → removal. The fingerprint comparison already detects any change made during the archive, so moving the archive out does not weaken preservation.
Keep all current refusal reasons, the fingerprint-last ordering, and started-mutation settlement. Apply the same pattern to branchReconcile.js removal (withClaimOwnershipLock around line 1569) if it also archives under the lock.
Acceptance criteria
-
archiveCheckoutno longer runs whilewithClaimOwnershipLockis held. A deterministic test with a deferred archive shows a concurrentcheckClaimOwnershipsettling while the archive is pending. - A claim
bindfor the checkout being retired is refused (checkout-retirement-reserved) for the whole archive, and is never admitted halfway through. - A change to the checkout content or administration during the archive still yields
checkout-content-changed/checkout-administration-changed, and the checkout is kept. - Existing heldCheckoutRecovery and claim-ownership suites pass unchanged in intent.
model:heavy because this reorders lock and fence boundaries around destructive removal. effort:high because the preservation invariants must be re-proven at each boundary.
- Lingua principale
- JavaScript
- Stelle
- 38
- Fork
- 32
- Merge medio
- 48m
- PR unite (30g)
- 987
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di atomantic/PortOS
-
Provide durable Windows process-settlement proof for release synchronizationForse già presa @atomantic l’ha presa 1 giorno fa. Apertaarea:cos-agents bug effort:high in-progress model:heavy plan planner:gpt-6-1-sol windows
atomantic/PortOS#13785 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Show publication and synchronization as independent task and agent milestonesForse già presa @atomantic l’ha presa 1 giorno fa. Apertaarea:cos-agents effort:medium enhancement in-progress model:medium plan planner:gpt-6-1-sol
atomantic/PortOS#13773 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Bound recognized test-cache proofs during merged checkout retirementForse già presa @atomantic l’ha presa 1 giorno fa. Apertaarea:cos-agents bug effort:high in-progress model:heavy plan planner:gpt-6-1-sol
atomantic/PortOS#13763 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
area:cos-agents decomposed effort:high enhancement epic model:heavy plan planner:gpt-6-1-sol
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
atomantic/PortOS#13760 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Diagnose intermittent Windows Git capability probe failure with bounded startup evidenceForse già presa @atomantic l’ha presa 1 giorno fa. Apertaarea:ci bug effort:high in-progress model:heavy plan planner:gpt-6-1-sol tests windows
atomantic/PortOS#13752 · 6 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di atomantic/PortOS
Issue simili
-
Website: add a Thai localeApertagood first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
TanbirRamim/open-source-radar#353 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
I maintainer di solito rispondono entro 2 giorni
-
design-review mac P3 ui
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
tosunlab/hisarapp-core#502 ·
-
enhancement status: needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
mastra-ai/mastra#28651 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement frontend help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
nikhilb2/simple_invoicing#470 ·
I maintainer di solito rispondono entro 1 giorno