Bound output-pipe drain after a child exits
A wrapper waiting for a child’s close event can hang after its exit event if a descendant retains an inherited output pipe. Capture the exit status separately, allow a short bounded drain, then terminate the wrapper-owned process group and fail if close never arrives. Give the whole setup a deadline as well, since a timeout around only the immediate launcher does not bound surviving descendants. Test with a child that spawns a heartbeat descendant, and verify both wrapper completion and descendant cleanup. A descendant that detaches from the group needs stronger containment.
Applies when: A CI setup command launches subprocesses with piped output. Keywords: child exit close pipe descendant timeout process group cleanup