stronglink icon indicating copy to clipboard operation
stronglink copied to clipboard

Slow queries run forever instead of timing out

Open btrask opened this issue 9 years ago • 1 comments

Currently we don't impose any timeout on slow queries. This can easily lead to saturating the thread pool and causing a denial of service.

This is a little bit more difficult because for trusted applications we don't want to impose timeouts. Either we need to add a special user permission for long-running queries, or else we need to figure out a compromise. Possibly preempting slow queries or something.

Obviously it'd be nice to simply speed up slow queries too. #22

btrask avatar Jul 18 '15 20:07 btrask

There are basically two ways to do this:

  1. By applying a cost factor to every step the filter does internally
  2. By setting a timer

I'm not sure which one is better. By counting steps, the result would be deterministic and unaffected by other processes or random slowdowns. On the other hand the timer might be more accurate/adaptive, for example if the whole system is running slow then we should probably terminate earlier.

btrask avatar Oct 04 '15 04:10 btrask