]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Limit `arc branch` to 16 concurrent processes
authorepriestley <git@epriestley.com>
Mon, 7 Jan 2013 16:44:55 +0000 (08:44 -0800)
committerepriestley <git@epriestley.com>
Mon, 7 Jan 2013 16:44:55 +0000 (08:44 -0800)
Summary:
Currently, this spawns 125 concurrent processes on my machine, which overflows some limit and gives me an error:

  PHP Warning:  proc_open(): unable to create pipe Too many open files in /INSECURE/devtools/libphutil/src/future/exec/ExecFuture.php on line 491

Instead, limit parallelism to 16. The runtime is approximately the same for me, and dominated by other concerns (conduit calls).

Test Plan: Ran `arc branch` successfully. Ran `arc branch --trace`, observed behavior.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran
Differential Revision: https://secure.phabricator.com/D4336

src/workflow/ArcanistBranchWorkflow.php

index 3bb891b87f138d182cc66b94ecab385d8d0630ac..3394f14f98dccae8060c5649767471a33ddab3c7 100644 (file)
@@ -149,7 +149,7 @@ EOTEXT
 
     $branches = ipull($branches, null, 'name');
 
-    foreach (Futures($futures) as $name => $future) {
+    foreach (Futures($futures)->limit(16) as $name => $future) {
       list($info) = $future->resolvex();
       list($hash, $epoch, $tree, $desc, $text) = explode("\1", trim($info), 5);