You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ProcessSpec cannot pass extra descriptors or control the session: blocks Perry's child_process #38
Perry's P2 migration moved child stdout/stderr pipes, dgram and signals onto turnloop, but child spawn and exit could not move, because ProcessSpec cannot express what Node's child_process needs:
Extra descriptors.ProcessSpec.stdio is exactly three entries. Node's fork() requires the IPC channel at fd 3 with NODE_CHANNEL_FD set, and spawn's stdio option takes an arbitrary list (['pipe','pipe','pipe','ipc','pipe',…]). turnloop needs a way to pass additional descriptors/handles at fixed child fd numbers (Windows: inherited handles plus the handle-value environment convention Node uses).
Alternative that would also unblock it:Loop::adopt_process(pid, …) — let the host spawn (keeping its own pre_exec, fd plan and reaping today) and hand turnloop only the exit watch. Note Perry has three other waitpid callers (spawnSync, execSync, pty) in the same process, so who reaps must be stated: an adopted-process API must not steal their children's status.
Whichever is chosen must keep exactly-once completion, the existing kill/close ordering, and grandchild cleanup (job object on Windows, process group on Unix).
Verification: a child with five descriptors where fds 3 and 4 carry real bytes both ways; NODE_CHANNEL_FD-style handoff; adopted-process exit status with a sibling waitpid caller present; Windows equivalents for inherited handles.
Implemented in #39: ProcessSpec.extra (ChildFd with Null/Pipe/Duplex/Handle sources at numbers 3..=MAX), controlling_terminal, and Loop::spawn_extra. adopt_process was evaluated and rejected with reasons (Job Object membership must precede descendants on Windows; no portable signature; Perry's whole child-hook set is now ProcessSpec fields). Verified on windows-2025 through the CRT descriptor convention libuv/Node use, and it uncovered a real bug where a failed exec could be reported as a successful spawn.
Activity
Extra child descriptors and session control at spawn (#38) (#39)
proggeramlug commentedon Sep 15, 2026
Implemented in #39:
ProcessSpec.extra(ChildFd with Null/Pipe/Duplex/Handle sources at numbers 3..=MAX),controlling_terminal, andLoop::spawn_extra.adopt_processwas evaluated and rejected with reasons (Job Object membership must precede descendants on Windows; no portable signature; Perry's whole child-hook set is now ProcessSpec fields). Verified on windows-2025 through the CRT descriptor convention libuv/Node use, and it uncovered a real bug where a failed exec could be reported as a successful spawn.