mountetna / magma

Data server with friendly data loaders
GNU General Public License v2.0
5 stars 2 forks source link

Complex queries do not time out. #65

Closed graft closed 5 years ago

graft commented 6 years ago

Because of large holes in the query design, it is easy for users to construct queries that result in very large tables being joined together, perhaps in triplicate. This is very bad and must be solved.

However, until that problem is solved, users can easily lock up Magma with long-running queries just by hitting reload on their favorite manifest a few times. This locks up Timur, which can't do anything without Magma data.

To prevent this disastrous situation from persisting, we can use the postgres variable statement_timeout; probably by adding this setting to the database role for magma. This way at least those queries will die and restore normal function within whatever statement_timeout is - maybe one minute?