Skip to content

Commit edd0afd

Browse files
committed
Multiprocessing - Parent process continued before all child processes where finished #219
1 parent 3a10a66 commit edd0afd

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

src/ExecutionTrait.php

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,9 @@ public static function executeChildProcesses(MonitoringItem $monitoringItem, arr
301301
}
302302
self::waitForChildProcesses($monitoringItem, $i, $numberOfchildProcesses);
303303
}
304-
self::waitForChildProcesses($monitoringItem, $i, $numberOfchildProcesses);
304+
305+
//make sure all child processes are finished
306+
self::waitForChildProcesses($monitoringItem, $i, 0);
305307
}
306308

307309
/**
@@ -332,24 +334,11 @@ protected static function childProcessCheck(MonitoringItem $monitoringItem): voi
332334
}
333335

334336
}
335-
/*
336-
* @param int $i
337-
* @param int $batchSize
338-
* @param int $numberOfchildProcesses
339-
*
340-
* @throws \Exception
341-
*/
342337

343338
/**
344-
* @param MonitoringItem $monitoringItem
345-
* @param int $baseline
346-
* @param int $maxProcesses
347-
*
348-
* @return void
349-
*
350339
* @throws \Exception
351340
*/
352-
protected static function waitForChildProcesses(MonitoringItem $monitoringItem, int $currentBatchIteration, int $maxProcesses = 0): void
341+
protected static function waitForChildProcesses(MonitoringItem $monitoringItem, int $currentBatchIteration, int $maxProcesses): void
353342
{
354343
do {
355344
$status = $monitoringItem->getChildProcessesStatus();

0 commit comments

Comments
 (0)