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
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.
Perry's P2 migration moved child stdout/stderr pipes, dgram and signals onto turnloop, but child spawn and exit could not move, because
ProcessSpeccannot express what Node'schild_processneeds:ProcessSpec.stdiois exactly three entries. Node'sfork()requires the IPC channel at fd 3 withNODE_CHANNEL_FDset, andspawn'sstdiooption 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).detachedexists (added for IOCP: CTRL_CLOSE_EVENT, CREATE_NO_WINDOW, KILL_ON_JOB_CLOSE and sync-handle semantics #11), but Perry also needs the pre-exec behaviour its current spawn path performs. Say explicitly which of those turnloop will own.Alternative that would also unblock it:
Loop::adopt_process(pid, …)— let the host spawn (keeping its ownpre_exec, fd plan and reaping today) and hand turnloop only the exit watch. Note Perry has three otherwaitpidcallers (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 siblingwaitpidcaller present; Windows equivalents for inherited handles.