zuul/zuul/driver/sql
James E. Blair 84c0420792 Add statement timeouts to some web sql queries
The SQL queries are designed to be highly optimized and should return
in milliseconds even with millions of rows.  However, sometimes
query planners are misled by certain characteristics and can end
up performing suboptimally.

To protect the web server in case that happens, set a statement or
query timeout for the queries which list builds or buildsets.  This
will instruct mysql or postgresql to limit execution of the buildset
or build listing queries to 30 seconds -- but only if these queries
originate in zuul-web.  Other users (such as the admin tools) may
still run these queries without an explicit time limit (though the
server may still have one).

Unfortunately (or perhaps fortunately) the RDBMSs can occasionally
satisfy the queries we use in testing in less than 1ms, making a
functional test of this feature impractical (we are unable to set
the timeout to 0ms).

Change-Id: If2f01b33dc679ab7cf952a4fbf095a1f3b6e4faf
2023-03-13 14:57:29 -07:00
..
alembic Address SqlAlchemy Removed in 2.0 Warnings 2023-01-30 11:49:30 -08:00
__init__.py Required SQL reporters 2021-02-03 13:41:55 -08:00
alembic.ini Add alembic.ini 2018-01-09 18:13:09 +01:00
sqlconnection.py Add statement timeouts to some web sql queries 2023-03-13 14:57:29 -07:00
sqlreporter.py Store pause and resume events on the build and report them 2023-01-02 10:07:26 +01:00