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.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 14, 11:55 PM
Unknown Object (File)
Sat, Dec 14, 5:28 PM
Unknown Object (File)
Thu, Dec 12, 9:50 AM
Unknown Object (File)
Mon, Dec 9, 10:11 AM
Unknown Object (File)
Mon, Dec 9, 7:09 AM
Unknown Object (File)
Tue, Dec 3, 4:47 PM
Unknown Object (File)
Wed, Nov 27, 3:50 PM
Unknown Object (File)
Wed, Nov 27, 6:22 AM
Subscribers
None

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
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

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 edited edge metadata.
This revision is now accepted and ready to land.Oct 20 2016, 3:53 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.