Held-checkout archiving holds the claim-ownership lock and starves ownership checks for minutes
メンテナーはふだん 1 日以内に返信
評価
この issue はまだ評価されていません。
説明
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.
- 主要言語
- JavaScript
- スター
- 38
- フォーク
- 32
- 平均マージ
- 40分
- マージ済み PR(30日)
- 988
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
atomantic/PortOS のほかの issue
-
Add a CoS system job to audit and improve PortOS claim instructions and delivery workflow対応中かも @atomantic が今日担当しました。 オープンenhancement plan
atomantic/PortOS#13533 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
bug effort:high model:heavy plan planner:gpt-6-1-sol
メンテナーはふだん 1 日以内に返信
-
area:ci bug effort:high model:medium needs-input plan planner:gpt-6-1-sol
atomantic/PortOS#13500 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
Add extensible execution options to shared provider/model/effort selection, starting with Codex Fast mode対応中かも @atomantic が今日担当しました。 オープンenhancement plan
atomantic/PortOS#13495 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Support resource-bounded whole-checkout preservation without initialized modules対応中かも @atomantic が今日担当しました。 オープンeffort:high enhancement in-progress model:heavy plan
atomantic/PortOS#13490 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
atomantic/PortOS の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
awesome-dsh-plugin/awesome-dsh-plugin#9184 ·
メンテナーはふだん 1 日以内に返信
-
Cloudredirectオープン
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
NanmiCoder/dsh-agent-teams#277 ·
メンテナーはふだん 1 日以内に返信
-
[ordering-review] workshop order graph: 1 confirmed ordering problem, 3 cycles are false positivesオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
githubnext/gh-aw-workshop#4943 ·
メンテナーはふだん 1 日以内に返信