Repository navigation
Description
What happened
On macOS, hide-platform/tests/process.rs guarded-launch tests fail with CaptureError { kind: Deadline } although the child already printed its result.
A guarded child that has finished its work stays alive in OwnerWatch drop, so the owner's capture runs into its deadline and cleanup reports TimedOut.
CI evidence:
- PR Run fake gh, tailscale and usage provider as Node scripts on Windows #436, job 111580209282 (macos-15):
only_a_guarded_launch_returns_startup_proofatprocess.rs:293; the captured stdout endschild_role ... GUARDED true. repeated_guarded_work_releases_children_and_capture_resourcesfailed the same way on macOS in 3 earlier runs.
Local measurement (macOS 15, taskpolicy -b plus 4 yes, ambient load average 40-80):
- The test failed about 1 run in 20 with a 1850 ms deadline and still failed with a 30 s deadline, so the child hangs rather than starts slowly.
- A hung child sampled at 9-11 s was in state
SNwith CPU time 0:00.01.
Its stack waschild_role-> drop ofOwnerWatch->OwnerWatch::close_inner->JoinHandle::join->_pthread_join, while theowned-child-watchreader thread stayed inUnixStream::read->__recvfrom. close_innersetscancelled, callschannel.shutdown(Both), then joins.
Neither the shutdown nor the reader's 25 msSO_RCVTIMEOwoke the reader for 11+ s.- With the ambient load back to 13 it no longer reproduced (0 in 520 runs), so it depends on a loaded machine.
What you expected
Dropping an OwnerWatch ends its reader promptly on every system, without relying on how the operating system delivers a shutdown or a receive timeout.
Steps to reproduce
- Build the
hide-platformprocesstest binary on macOS. - Start 4
yesprocesses and runtaskpolicy -b <process-test-binary> only_a_guarded_launch_returns_startup_proof --exactrepeatedly, on a machine whose load average is already high. - Sample a
child_roleprocess that is older than 9 s.
Not reproducible on an idle machine.
Versions
- hide: main at 59d13d9
- macOS: 15.1 (local), macos-15 (CI)
Diagnostics
Fix direction (approved): the reader polls the socket and a wake channel together, and drop wakes it and then joins, the pattern LocalListener::accept already uses.
The regression test orders the events itself: it waits until the reader is inside its poll, drops the OwnerWatch, and checks that the join ends by the wake.
Activity