Page MenuHomePhabricator

Query for global Feed Transaction Logs: Exception: ConpherenceTransactionQuery overheated
Closed, ResolvedPublic

Description

Upstreamed as https://we.phorge.it/T15642

  1. Go to https://phabricator.wikimedia.org/feed/
  2. Select "Transaction Logs" from the sidebar

Results:

Query (of class "ConpherenceTransactionQuery") overheated: examined more than 1,010 raw rows without finding 101 visible objects.

[2023-08-14 23:09:03] EXCEPTION: (Exception) Query (of class "ConpherenceTransactionQuery") overheated: examined more than 1,010 raw rows without finding 101 visible objects. at [<phabricator>/src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php:342]
 arcanist(), ava(), phabricator(), translations(), wmf-ext-misc()
   #0 <#2> PhabricatorPolicyAwareQuery::execute() called at [<phabricator>/src/applications/feed/query/PhabricatorFeedTransactionQuery.php:107]
   #1 <#2> PhabricatorFeedTransactionQuery::loadPage() called at [<phabricator>/src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php:251]
   #2 <#2> PhabricatorPolicyAwareQuery::execute() called at [<phabricator>/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:400]
   #3 <#2> PhabricatorCursorPagedPolicyAwareQuery::executeWithCursorPager(AphrontCursorPagerView) called at [<phabricator>/src/applications/search/engine/PhabricatorApplicationSearchEngine.php:1038]
   #4 <#2> PhabricatorApplicationSearchEngine::executeQuery(PhabricatorFeedTransactionQuery, AphrontCursorPagerView) called at [<phabricator>/src/applications/search/controller/PhabricatorApplicationSearchController.php:256]
   #5 <#2> PhabricatorApplicationSearchController::processSearchRequest() called at [<phabricator>/src/applications/search/controller/PhabricatorApplicationSearchController.php:91]
   #6 <#2> PhabricatorApplicationSearchController::processRequest() called at [<phabricator>/src/aphront/AphrontController.php:29]
   #7 <#2> AphrontController::handleRequest(AphrontRequest) called at [<phabricator>/src/aphront/AphrontController.php:71]
   #8 <#2> AphrontController::delegateToController(PhabricatorApplicationSearchController) called at [<phabricator>/src/applications/search/engine/PhabricatorApplicationSearchEngine.php:50]
   #9 <#2> PhabricatorApplicationSearchEngine::buildResponse() called at [<phabricator>/src/applications/feed/controller/PhabricatorFeedTransactionListController.php:13]
   #10 <#2> PhabricatorFeedTransactionListController::handleRequest(AphrontRequest) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
   #11 phlog(Exception) called at [<phabricator>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]
   #12 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, Exception) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
   #13 AphrontApplicationConfiguration::handleThrowable(Exception) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
   #14 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:204]
   #15 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phabricator>/webroot/index.php:35]

See Also:

Note to myself: Easy to reproduce locally on /feed/transactions/ after creating 900 tasks and then mass-setting their view policy to a different user

Event Timeline

Aklapper triaged this task as Low priority.

Created and set up a new custom default query not covering "All Transactions" (and thus not indexing Conpherence) in order to hide the problem: https://phabricator.wikimedia.org/feed/transactions/

I posted a potential approach to mitigate in P53126: do not query disabled applications.

1diff --git a/src/applications/conpherence/query/ConpherenceTransactionQuery.php b/src/applications/conpherence/query/ConpherenceTransactionQuery.php
2index d227217cb4..7c5ad2b23c 100644
3--- a/src/applications/conpherence/query/ConpherenceTransactionQuery.php
4+++ b/src/applications/conpherence/query/ConpherenceTransactionQuery.php
5@@ -7,4 +7,8 @@ final class ConpherenceTransactionQuery
6 return new ConpherenceTransaction();
7 }
8
9+ public function getApplicationClassName() {
10+ return 'PhabricatorConpherenceApplication';
11+ }
12+
13 }
14diff --git a/src/applications/feed/query/PhabricatorFeedTransactionQuery.php b/src/applications/feed/query/PhabricatorFeedTransactionQuery.php
15index d0a9f53e35..42ee332c1c 100644
16--- a/src/applications/feed/query/PhabricatorFeedTransactionQuery.php
17+++ b/src/applications/feed/query/PhabricatorFeedTransactionQuery.php
18@@ -155,6 +155,20 @@ final class PhabricatorFeedTransactionQuery
19 ->setAncestorClass('PhabricatorApplicationTransactionQuery')
20 ->execute();
21
22+ // Remove TransactionQuery classes that belong to previously installed apps
23+ // which got uninstalled in the meantime: Increases query performance and
24+ // decreases likeliness that a Query Overheated error will be displayed.
25+ // See also https://secure.phabricator.com/T13133 for more background.
26+ foreach ($queries as $key => $query) {
27+ if (method_exists($query, 'getApplicationClassName')) {
28+ $application_class_name = $query->getApplicationClassName();
29+ $application = new $application_class_name();
30+ if (!$application->isInstalled()) {
31+ unset($queries[$key]);
32+ }
33+ }
34+ }
35+
36 $type_map = array();
37
38 // If we're querying for specific transaction PHIDs, we only need to

This issue should now be fixed on phabricator.wikimedia.org after today's software deployment in T404134.