The patch to bug 1979546 refactored the logic that awaits the process termination. The logic that processes process termination should stop the poll loop() via updatePollEvents(). This did not happen, because updatePollEvents() considered a process alive if it is in `io.processes`, but the updatePollEvents() was not called when `cleanupProcess` cleared the last reference. Consequently, the poll loop continued forever if the process's pipes closed before the process. Original Revision: https://phabricator.services.mozilla.com/D261060 Differential Revision: https://phabricator.services.mozilla.com/D266338