Skip to content

Commit

Permalink
Pool: read process output to avoid hang state with large output
Browse files Browse the repository at this point in the history
  • Loading branch information
FreezeWarp committed Oct 16, 2019
1 parent f20f296 commit deab44e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Pool.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ public function wait(?callable $intermediateCallback = null): array
if ($process instanceof SynchronousProcess) {
$this->markAsFinished($process);
}

/*
* There are likely better solutions here, but basically, without this line, we enter a hang state if the output is sufficiently large (I'm assuming larger than the stdout buffer size).
* So if we configure our pool to support large outputs, but don't actually attempt to read the output here, then the child process never exists, SIGCHILD never fires, and our pool never closes.
*/
$process->getOutput();
}

if (! $this->inProgress) {
Expand Down

0 comments on commit deab44e

Please sign in to comment.