Repository navigation
fix(windows): bigint probe identity in runtime preflight; release CC-Switch F3 WAL handles - #7986
Conversation
NTFS file IDs exceed 2^53, where adjacent IDs are equal as JS numbers. The owned-probe check could then mistake a replacement directory for its own probe and remove it, and the replacement-root test failed on windows 2/11 of run 41021347487 with ino 10696049116378316.
Unfinalized prepare().run() statements keep the SQLite db, -wal and -shm open past close(), so Windows refused to remove the temp tree (EBUSY on windows 10/11 of run 41021347487).
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 37 minutes. View limit details
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 |
|
✅ Deterministic PR hygiene checks passed. |
|
Maintainer integration (lane L1, cross-platform CI). Squash-merging into dev under the maintainer-integration exception in MAINTAINERS.md. This records the decision; it is not a self-approval. Exact head: |
Summary
Fixes two Windows-only failures from manual Cross-platform CI run 41021347487 (
lane=all, dev3ea89653f).10696049116378316. Above 2^53, adjacent IDs compare equal as numbers.src/lib/bun-runtime-preflight.tsidentified its own probe directory by numberdev/ino, both in-process and in the child script. A replacement directory could therefore pass the "this is my probe" check and be removed. The check now useslstatSync(path, { bigint: true }). The existing replacement-root test used the same number comparison and failed on CI, so it now compares bigints too. A new deterministic case injects an owned probe and a replacement whose IDs differ only above 2^53. Cleanup must leave the replacement in place. This case fails on the old source and passes on the new one.writer.prepare(...).run(...)and never finalized those statements.close()therefore did not releaselive-wal.db,-waland-shm, and Windows refused to remove the temp tree (EBUSY, 15 s of retries). An isolated probe that did not call the product reproduced the EBUSY. After the statements were finalized, deletion succeeded. The importer closes its own descriptor on the refusal path, so the product needs no change. The test now useswriter.run(sql, ...params), which finalizes each statement. Its assertions are unchanged.windows 4/11 of the same run (30 min timeout) was a slow runner. On that VM, setup steps took about 4× longer before any test ran (Setup Bun 26 s vs 5–8 s on the other ten shards, Install dependencies 64 s vs 12–18 s), and test durations rose broadly (median 1.36×, p75 2.6×). Neither repository change caused it, so this PR has no code change for it. The batched
lane=alldispatch after merge will confirm.Verification
bun test tests/lib/bun-runtime-preflight.test.tsbefore the src change: 15 pass / 1 fail (the new above-2^53 case). After: 59 pass / 0 fail acrosstests/lib/bun-runtime-preflight.test.ts,tests/service/service-runtime-preflight.test.ts,tests/service/service-desktop-runtime-preflight.test.tsandtests/codex-integration/codex-shim-runtime-preflight.test.ts(Windows 11, Bun 1.4.4).bun test tests/providers/cc-switch-import.test.tson Windows, before: 8 pass / 1 fail (F3 EBUSY at cleanup, 14.9 s). After: 9 pass / 0 fail, F3 49 ms.bun run typecheck: 2,243 files, no errors.bun run test:changedlocally: first run hit its lane deadline (exit 124) on a machine shared with other test lanes; the rerun was stopped deliberately to free the shared host. Import-graph coverage comes from the hostedtest changedjob on the exact head (pass).bun run testlocally, because other lanes are running Bun suites on the same machine. Hosted Windows coverage comes from the batchedlane=alldispatch on dev after merge, since PR CI runs Ubuntu only.Checklist