Ref T11699. Currently, arc patch D123 will make a Conduit request to differential.querydiffs with parameters ['revisionIDs' => ['D123']]. This ends up loading all DifferentialDiffs associated with a DifferentialRevision, as well as the changeset for each diff. Arcanist then discards most of the response by calling head($future->resolve()).
We had users reported that arc patch was failing for one particular Differential revision:
[2018-09-16 23:47:57] EXCEPTION: (HTTPFutureCURLResponseStatus) [cURL/28] (https://phabricator.REDACTED/api/differential.querydiffs) <CURLE_OPERATION_TIMEDOUT> The request took too long to complete. at [<phutil>/src/future/http/HTTPSFuture.php:408] arcanist(head=master, ref.master=30b7835c37b5), flarc(), phutil(head=master, ref.master=a28f6e5d64f3) #0 HTTPSFuture::isReady() called at [<phutil>/src/future/Future.php:37] #1 Future::resolve(NULL) called at [<phutil>/src/future/FutureProxy.php:34] #2 FutureProxy::resolve() called at [<arcanist>/src/workflow/ArcanistWorkflow.php:1195] #3 ArcanistWorkflow::loadBundleFromConduit(ConduitClient, array) called at [<arcanist>/src/workflow/ArcanistWorkflow.php:1186] #4 ArcanistWorkflow::loadRevisionBundleFromConduit(ConduitClient, string) called at [<arcanist>/src/workflow/ArcanistPatchWorkflow.php:377] #5 ArcanistPatchWorkflow::run() called at [<arcanist>/src/workflow/ArcanistPatchWorkflow.php:390] #6 ArcanistPatchWorkflow::run() called at [<arcanist>/scripts/arcanist.php:394]
I personally couldn't reproduce this issue, but I did notice that the response from differential.querydiffs was ridiculously large:
> echo '{"revisionIDs": ["105748"]}' | arc call-conduit differential.querydiffs | wc --bytes 14278157
Instead of modifying differential.querydiffs (which is frozen), we can improve the performance of arc patch by looking up the most-recent DifferentialDiff for the specified DifferentialRevision and calling differential.querydiffs with ids instead of revisionIDs.