Page MenuHomePhabricator

Fix a bug which prevented Conduit futures from having parallelism limited effectively
ClosedPublic

Authored by epriestley on Oct 12 2017, 7:18 PM.
Tags
None
Referenced Files
F18566421: D18704.id.diff
Tue, Sep 9, 2:36 PM
F18501736: D18704.diff
Thu, Sep 4, 9:56 PM
F18434025: D18704.diff
Sun, Aug 31, 8:46 AM
F18096777: D18704.id44897.diff
Aug 8 2025, 9:08 AM
F18084571: D18704.id.diff
Aug 5 2025, 4:08 PM
F18074901: D18704.diff
Aug 4 2025, 5:55 PM
F17947263: D18704.diff
Jul 31 2025, 3:54 PM
Unknown Object (File)
Jul 2 2025, 6:54 PM
Subscribers
None

Details

Summary

Ref T13008. Currently, ConduitClient calls isReady() on futures before returning them.

This is very old, and wrong: it makes the future activate and start working. In the case of ConduitFutures, which wrap HTTPFutures, it causes them to make an HTTP request.

Instead, return dormant futures without calling isReady(). Then the construct used by ArcanistFileUploader and many other pieces of code will limit parallelism properly:

$iterator = id(new FutureIterator($futures))
  ->limit(4);
foreach ($iterator as $future) {
 // ...
}

Also, fix up the --trace profiler integration so we get a log when the future actually starts, not when we create it.

Test Plan

Ran arc upload --trace ... with a bunch of files, fiddling with the limit(X). Saw 4 (default) and 1 properly throttle requests. Saw 200 unthrottle requests.

Diff Detail

Repository
rPHU libphutil
Lint
Lint Not Applicable
Unit
Tests Not Applicable