Skip to content

Commit

Permalink
Merge pull request #100 from neighborhoods/KOJO-178-guard-against-ful…
Browse files Browse the repository at this point in the history
…l-process-pool-when-polling-singletons

KOJO-178 | Guard against full process pool when Root is polling singletons
  • Loading branch information
mucha55 committed Jan 22, 2020
2 parents 42a3e69 + e60aa1f commit 5450914
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Process/Root.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ protected function pollSingletonProcesses() : Root
if ($semaphoreResource->testLock()) {
try {
$process = $this->_getProcessCollection()->getProcessPrototypeClone($singletonType);
$this->_getProcessPool()->addChildProcess($process);
if (!$this->_getProcessPool()->isFull()) {
$this->_getProcessPool()->addChildProcess($process);
}
} catch (Forked\Exception $forkedException) {
// this is fine, another execution environment will spawn this process
// TODO: consider breaking here to stop attempting to spawn other singletons
Expand Down

0 comments on commit 5450914

Please sign in to comment.