Skip to content

Fix native process descriptor test reaper race - #286

Draft
pcarrier wants to merge 9 commits into
mainfrom
pc/native-process-test-reaper-fix
Draft

Fix native process descriptor test reaper race#286
pcarrier wants to merge 9 commits into
mainfrom
pc/native-process-test-reaper-fix

Conversation

@pcarrier

Copy link
Copy Markdown
Contributor

Summary

  • preserve a native process child's backstop-parked exit status when the shared reaper wins the test's wait race
  • mirror the production wait_child cleanup order: deregister after a successful direct wait, or consume the parked status after a wait error

Root cause

The late-open file-descriptor regression unconditionally deregistered its child before inspecting Child::wait(). Under full-suite contention, the shared reaper could collect the child first and park status 0; deregistration then deleted that status, so the test falsely reported descriptor inheritance.

This was test bookkeeping, not a production descriptor leak. The production wait path already used the correct ordering.

Follow-up to #285.

Validation

  • cargo test -p blit-server --lib descriptors_opened_after_command_construction_are_not_inherited
  • cargo test -p blit-server --lib — 484 passed
  • stress verification — 25 focused repetitions and five complete server suites passed
  • cargo fmt -p blit-server -- --check
  • cargo clippy -p blit-server --lib -- -D warnings
  • git diff --check

Add the desktop process bridge, media and notification protocol support, live client controls, and the accompanying iPad tray and workspace refinements.
Preserve macOS dead-key composition, resolve relative Markdown links, and keep kicked mux clients disconnected.
## Summary

- implement feature bit 13 and the native non-PTY process packet family, plus transport-neutral Rust command/child/list/watch helpers
- give every started child a public, server-boot-scoped `process_ref`; apny process-capable client can list live children, concurrently watch future output, and issue lifecycle controls without a bearer/adoption token
- inherit the complete server process environment, with client-supplied entries overriding matching inherited keys; there is no `CLEAR_ENV` mode
- provide independent per-watch output credit, an explicit single stdin-writer request, public retained results for detachable children, and owner-bound lifetime for ordinary children
- enforce endpoint, generation, watcher, request, stream-window, and process-outbox limits; close stalled/overflowed endpoints instead of silently dropping committed process frames
- contain Unix children in process groups and Windows children in kill-on-close jobs, with residual-tree cleanup, shared-reaper integration, descriptor hygiene, bounded shutdown, and Windows lifecycle CI
- integrate feature negotiation, disabled-family replies, fair bulk scheduling, `BLIT_PROCESS=0` / `--no-processes`, startup policy settings, and operator/RFC documentation

There is intentionally no cross-client process confidentiality or control boundary: process-capable clients can discover, watch, and control one another's native children. The low-level packet/accounting API is included; integrated native-client and extension convenience SDKs remain follow-up work.

## Validation

- `cargo test -p blit-server --lib` — 484 passed
- `cargo test -p blit-remote --lib` — 240 passed
- `cargo test -p blit-cli --bin blit` — 93 passed
- `./bin/lint --check` — Rust formatting, Prettier, and the full clippy matrix passed
- focused post-rebase process suite — 33 server and 12 remote tests passed
- independent lifecycle/resource and wire/API review — no remaining actionable findings
@github-actions

Copy link
Copy Markdown

Coverage

Crate Lines Functions Regions
alacritty-driver 73.5% (837/1139) 76.4% (68/89) 77.0% (1360/1767)
browser 0.0% (0/822) 0.0% (0/68) 0.0% (0/1401)
cli 25.8% (2621/10152) 37.3% (320/857) 28.0% (4341/15517)
compositor 33.4% (5574/16692) 47.4% (457/965) 33.2% (7635/22993)
desktop 73.0% (1704/2335) 65.0% (147/226) 68.7% (2440/3550)
fonts 85.3% (756/886) 89.9% (71/79) 86.4% (1485/1719)
fssync 92.5% (5514/5961) 94.4% (501/531) 92.7% (10179/10981)
gateway 30.9% (498/1610) 34.2% (50/146) 26.2% (697/2663)
git 87.6% (4434/5060) 89.6% (360/402) 87.4% (7065/8082)
lsp 77.4% (2688/3471) 79.4% (262/330) 75.2% (4210/5595)
proxy 19.2% (172/898) 20.5% (26/127) 21.0% (293/1392)
remote 91.1% (12431/13652) 93.3% (898/962) 88.9% (20550/23111)
sd-notify 72.8% (67/92) 100.0% (6/6) 82.4% (108/131)
server 54.4% (16134/29656) 66.1% (1446/2188) 55.8% (25797/46194)
ssh 32.2% (165/512) 48.2% (27/56) 31.4% (261/830)
upsidedown 31.4% (391/1247) 27.8% (55/198) 34.8% (797/2287)
webrtc-forwarder 7.2% (198/2765) 10.3% (21/204) 5.3% (243/4549)
webserver 64.4% (1239/1924) 67.5% (172/255) 66.6% (2090/3138)
Total 56.1% (55423/98874) 63.6% (4887/7689) 57.4% (89551/155900)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant