Repository navigation
fix(desktop): serialize shim publication with production process creation (ETXTBSY) - #7106
Conversation
Share a Unix test read/write lock between executable fixture writes and every synchronous subprocess spawn. Close-on-exec does not prevent a forked child from temporarily retaining a writer, which made direct shim execution return ETXTBSY during the CLI record lock stress test. Keep non-executable record writes and all four stress spawners concurrent, and assert that executable writes wait until spawn protection ends.
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
📝 Walkthrough
Merge Risk: 🔵 Low · up to
|
|
✅ Deterministic PR hygiene checks passed. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 17c60c4128
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Maintainer integration into
|
Summary
Fix the Unix
ETXTBSYrace when a newly installed desktop shim is executed. Atomic replacement flushes and closes its writer before publishing by rename. A production process-wide gate now excludes executable writes from shell-owned process creation, so a fork cannot retain a writable duplicate after the parent closes its descriptor. Ordinary record writes and concurrent spawners remain independent.The spawn inventory covers bundled runtime start, resolve/claim/stop output futures, launchctl/plutil login probes, browser and Login Items launchers, updater installation helpers, and app restart. The configured LaunchAgent and Linux autostart registration write files without spawning. Windows uses the same entry points without synchronization. Lazy output futures acquire the gate during each poll, releasing before yielding; no lock spans an output await. The standard-library gate lets launchers join existing launchers while a writer is queued, avoiding a deadlock if an updater waits for a main-thread callback that opens a URL. Only an active writer excludes spawns.
Rust fixtures use the production gate instead of a
cfg(test)copy. Tests cover both exclusion directions, release before child exit, spawn errors, async Pending release and the updater callback ordering. The login-command deadline regression retains its child-process isolation and original timing/slot assertions. Currentdev(7640a942b, including #7107) remains merged without rebasing or force-pushing.Verification
cargo test --locked --manifest-path .tmp/rust-cli-harness/Cargo.toml: 57 passed, 0 failed, 2 existing opt-in tests ignored. The isolated harness imports the real record, POSIX, Windows, login-registration and process-spawn modules.cargo check --lockedon that harness also passes withoutcfg(test).bun test tests/clients/desktop-cli-contracts.test.ts tests/clients/desktop-cli-command-surface.test.ts tests/clients/desktop-startup-surface.test.ts tests/clients/desktop-exit-ownership.test.ts: 58 passed, 0 failed.bun test tests/clients/desktop-update-surface.test.ts tests/clients/desktop-start-at-login-default.test.ts tests/clients/desktop-tray-availability.test.ts: 25 passed, 0 failed.bun run typecheck,bun run structure:check,bun run privacy:scan,cargo fmt --manifest-path desktop/src-tauri/Cargo.toml --check,git diff --check: pass.desktop shellsupplies the complete crate build and tests.lane=allsupplies the broader Linux/macOS/Windows coverage. Pending, skipped and cancelled checks are not passing evidence.lane=allone504c23cc: run 38741932609 dispatched; Linux desktop shell and all platforms are pending. Results will be recorded here when complete. Earlier run 38698251320 is green on 6a12ee3 and is not evidence for this new head.Checklist
structure/desktop-terminal-command.mdand its shell cross-reference).Summary by CodeRabbit