Orphaned grandchild process silently blocked pipe reads by holding write descriptor open
A developer discovered their program had silently hung for forty minutes at zero percent CPU while waiting for an EOF signal that never arrived. The root cause was a grandchild process — spawned by the tool being orchestrated — that had inherited the pipe's write-end file descriptor from its parent. When the parent process was killed by a timeout, the grandchild remained alive with its copy of the descriptor open, preventing EOF from ever being delivered to the reader. Unlike a CPU-spinning infinite loop, this class of hang is nearly invisible in process monitors and metrics, appearing only as a slow-running task. The fix was to apply a timeout to the drain phase itself, abandoning the read after a few seconds if EOF does not arrive, ensuring no indefinite waits on conditions that may never be fulfilled.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in