1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-09-19 16:38:51 +02:00

Impose a HardpointEngine future parallelism limit

Summary:
Ref T13546. If we try to resolve several hundred hardpoint queries which execute subprocesses, we can currently hit system limits.

For now, limit resolution to 32 simultaneous futures. In the future, this should switch to `FuturePool` and possibly become more nuanced.

Test Plan: In a future change, ran `arc land --into-empty ...` to land thousands of commits. Before change, got a "proc_open()" error when launching too many simultaneous subprocesses. After change, this "worked".

Maniphest Tasks: T13546

Differential Revision: https://secure.phabricator.com/D21307
This commit is contained in:
epriestley 2020-06-04 09:40:18 -07:00
parent 7378e2baad
commit fc3974ed70

View file

@ -192,7 +192,8 @@ final class ArcanistHardpointEngine
$wait_futures = $this->waitFutures;
if ($wait_futures) {
if (!$this->futureIterator) {
$iterator = new FutureIterator(array());
$iterator = id(new FutureIterator(array()))
->limit(32);
foreach ($wait_futures as $wait_future) {
$iterator->addFuture($wait_future);
}