Page MenuHomePhabricator

Make query engines "overheat" instead of stalling when filtering too many results
ClosedPublic

Authored by epriestley on Oct 20 2016, 3:36 PM.

Details

Summary

Ref T11773. This is an initial first step toward a more complete solution, but should make the worst case much less bad: prior to this change, the worst case was "30 second exeuction timeout". After this patch, the worst case is "no results + explanatory message", which is strictly better.

Test Plan

Made all feed stories fail policy checks, loaded home page.

  • Before adding overheating: 9,600 queries / 20 seconds
  • After adding overheating: 376 queries / 800ms

Diff Detail

Repository
rP Phabricator
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

epriestley updated this revision to Diff 40295.Oct 20 2016, 3:36 PM
epriestley retitled this revision from to Make query engines "overheat" instead of stalling when filtering too many results.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.
chad accepted this revision.Oct 20 2016, 3:53 PM
chad edited edge metadata.
This revision is now accepted and ready to land.Oct 20 2016, 3:53 PM
epriestley updated this revision to Diff 40296.Oct 20 2016, 3:54 PM
epriestley edited edge metadata.

For clarity, only enforce the overheat limit if the query has a limit.

We can't currently reach the check without a limit, but this is a little easier to read and future-proofs us against reorganization of this code.

This revision was automatically updated to reflect the committed changes.