From 32c82a53deb426bd4137a109851139fc149e176a Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 26 Jan 2021 15:39:22 -0800 Subject: [PATCH] After loading the effective Viewer during a VCS request, flag them for inline cache generation Summary: Ref T13590. User objects have some inline caches that don't do readthrough generation by default because it may be indicative of high-impact performance problems in code. During a VCS request, these caches are normally unnecessary, but they may be hit on some unusual pathways (like error handling). Flag VCS users as okay for inline generation. This does not indicate a performance problem and access to these caches is very rare, at least today. Test Plan: - Executed a Git HTTP request which hit an unhandled exception (stuck write lock). - Before: got a second-level exception while handling the first exception, when trying to access user preferences to render a standard uncaught exception page. - After: no second-level exception. Maniphest Tasks: T13590 Differential Revision: https://secure.phabricator.com/D21524 --- .../diffusion/controller/DiffusionServeController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/applications/diffusion/controller/DiffusionServeController.php b/src/applications/diffusion/controller/DiffusionServeController.php index 1a1383368f..b9064863b1 100644 --- a/src/applications/diffusion/controller/DiffusionServeController.php +++ b/src/applications/diffusion/controller/DiffusionServeController.php @@ -214,6 +214,11 @@ final class DiffusionServeController extends DiffusionController { $viewer = new PhabricatorUser(); } + // See T13590. Some pathways, like error handling, may require unusual + // access to things like timezone information. These are fine to build + // inline; this pathway is not lightweight anyway. + $viewer->setAllowInlineCacheGeneration(true); + $this->setServiceViewer($viewer); $allow_public = PhabricatorEnv::getEnvConfig('policy.allow-public');