diff --git a/src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php b/src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php --- a/src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php +++ b/src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php @@ -233,7 +233,10 @@ // number of records when the viewer can see few or none of them. See // T11773 for some discussion. $this->isOverheated = false; - $overheat_limit = $limit * 10; + + // See T13386. If we on an old offset-based paging workflow, we need + // to base the overheating limit on both the offset and limit. + $overheat_limit = $need * 10; $total_seen = 0; do {