From b757e5c30249f066b0bd37a25e9416d0c3084ea2 Mon Sep 17 00:00:00 2001 From: epriestley Date: Sat, 4 Sep 2021 14:08:06 -0700 Subject: [PATCH] Use "MethodCallFuture" to move Diffusion Conduit exceptions to resolution time Summary: Depends on D21720. Ref T13666. See D21720 for additional discussion. Use "MethodCallFuture", introduced in D21720, so that exceptions raised in "execute()" are thrown when the future is resolved, not when the future is created. This makes exception behavior for clustered and non-clustered setups consistent, and chooses the intended (clustered) behavior in both cases, which currently deals with errors better. Test Plan: - Applied both parts of the patch in T13666 (break history queries, force immediate futures) to reproduce the issue in T13666. - Loaded a Diffusion landing page, reproduced the error described in that task. - Applied this patch, verified landing page works again. - Removed the "break history queries" change, verified landing page works in forced-immediate mode. - Removed the "force immediate" change, verified landing page works in "actual future" mode. Reviewers: cspeckmim Reviewed By: cspeckmim Maniphest Tasks: T13666 Differential Revision: https://secure.phabricator.com/D21721 --- .../repository/storage/PhabricatorRepository.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/applications/repository/storage/PhabricatorRepository.php b/src/applications/repository/storage/PhabricatorRepository.php index 9cbc6db76d..e719f2cd73 100644 --- a/src/applications/repository/storage/PhabricatorRepository.php +++ b/src/applications/repository/storage/PhabricatorRepository.php @@ -2269,10 +2269,9 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO $never_proxy); if (!$client) { - $result = id(new ConduitCall($method, $params)) - ->setUser($viewer) - ->execute(); - $future = new ImmediateFuture($result); + $conduit_call = id(new ConduitCall($method, $params)) + ->setUser($viewer); + $future = new MethodCallFuture($conduit_call, 'execute'); } else { $future = $client->callMethod($method, $params); }