From cbbbd36189c564930937d9dfc02ba4fc7bd39a6b Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Wed, 13 Jan 2021 18:12:19 +0100 Subject: [PATCH] Smoother parallel process quitting when the child process crashes --- src/Parallel/ParallelAnalyser.php | 4 ++-- src/Parallel/ProcessPool.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Parallel/ParallelAnalyser.php b/src/Parallel/ParallelAnalyser.php index b921cc0d66..48bc78f294 100644 --- a/src/Parallel/ParallelAnalyser.php +++ b/src/Parallel/ParallelAnalyser.php @@ -76,7 +76,7 @@ public function analyse( $process = $this->processPool->getProcess($identifier); $process->bindConnection($decoder, $encoder); if (count($jobs) === 0) { - $this->processPool->quitProcess($identifier); + $this->processPool->tryQuitProcess($identifier); return; } @@ -174,7 +174,7 @@ public function analyse( } if (count($jobs) === 0) { - $this->processPool->quitProcess($processIdentifier); + $this->processPool->tryQuitProcess($processIdentifier); return; } diff --git a/src/Parallel/ProcessPool.php b/src/Parallel/ProcessPool.php index 20c293ba73..a411712cef 100644 --- a/src/Parallel/ProcessPool.php +++ b/src/Parallel/ProcessPool.php @@ -41,7 +41,7 @@ public function tryQuitProcess(string $identifier): void $this->quitProcess($identifier); } - public function quitProcess(string $identifier): void + private function quitProcess(string $identifier): void { $process = $this->getProcess($identifier); $process->quit();