Repository navigation
test(update): stop the lease holder fixture from cold-importing the service graph - #6661
Conversation
…ervice graph on Windows
|
✅ Deterministic PR hygiene checks passed. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe update lease test now resolves service-state paths in the parent process and passes them to the spawned holder. The holder retains its child-side containment and authority checks. ChangesUpdate lease holder
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Other Merge Risk: ⚪ Minimal · up to The fixture change preserves its path, authority, and lease checks while avoiding the holder’s cold import. No concrete merge-blocking risk is evident. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
🛠️ Fix failing CI checks 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Maintainer integration (lidge-jun, dev only) — 2026-10-05 bug triage round 2, lane B8.
|
Summary
On dev f924820, full-matrix run 37407882844 failed
windows 9/9on all three attempts intests/update/update-restart-lease.test.ts. In each attempt, aspawnHolderchild missed its 8 s acknowledgment window ("holder did not acknowledge acquisition"); the affected case differed between attempts.The cause is the holder fixture. Before it can acquire the lease, it re-resolves the service-state paths in a fresh Bun child by cold-importing
src/service/state.ts, which pulls in the whole config graph (about 460 modules and about 1 s of CPU). On hosted Windows runners that cold import has a multi-second I/O-latency tail. Instrumented holders spent up to 8.0 s of wall time on 0.6 s of CPU inside theconfig.tsimport, and a cross-run scan of 24 Windows runs shows the same tail (holder cases at 4–19 s against a normal 0.8 s). The failures are that tail crossing the 8 s budget.The fix: the holder now receives the paths the parent already resolved and proved contained in
sandbox(), and imports onlysrc/service/ownership-mutation-lease.mjs(Node builtins only). That is the same shapecontenderAcquireand the restart-veto inline holder already use. The holder still checks containment against the sandbox root and the authority match before it acquires, and the parent still verifies the receipt and the lock owner PID. Child-side authority resolution from the stored service-manager environment stays covered byserviceManagerChildAuthority()(the case 1/2 controls and two restart-veto cases).This is test-only. The patch changes no product source, and the stall sits in fixture import plumbing ahead of any lease logic. Diagnostics on the throwaway branch
codex/b8-lease-windows-diag(runs 37414104873, 37415821537, 37417148609, 37419782477, 37419800317) ruled out the suspected product causes:ocx startwith the Claude intercept on and off (fix(claude): retain approved Desktop picker trust across restarts #6639's Windows CA work) stalled in both arms.These diagnostics do not show that product startup is free of similar cold-import latency on such runners.
Verification
No local tests were run, per owner instruction.
bun run typecheck,bun run privacy:scan,bun run structure:check,bun scripts/file-size-ratchet.tsall exit 0. No new files; this file has no ratchet entry.c9bdcd7c26f629373b4fcebf7b61f5971344503d: run 37422534227 green (full-matrix jobs skip on pull_request by design).lane=alldispatches at the same head:windows 9/9green in 37422532742 (job 112134885543) and 37422563221 (job 112137937070). Holder-driven cases now acknowledge in 53–373 ms (EOF release 252/140 ms, drain-cleanup 76/81 ms, missing-ack 53/373 ms), down from 0.8–1.1 s normally and 4–19 s on the tail. The 8 s cases sit at their designed graceful-timeout floor (8.05–8.22 s).windows 6/9andwindows 7/9failed in files this PR does not touch: the tray probe timing assertion (Expected: < 250,Windows tray packaging and command safety > terminates and later reaps hung, overflowing, or failed tray probes without stacking) andGET /api/settings reports external Codex ownership without an apply attempt(10.5 s). Every Windows shard passed in 37422563221; the failed jobs are being rerun.Checklist