mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 22:10:55 +01:00
Prevent web queries from running for more than 30 seconds
Summary: Ref T10849. This enforces a global 30-second per-query time limit for anything not coming from the CLI. If we run into another issue with MySQL hanging in the future, this should prevent it from being nearly as bad as it was. Test Plan: - Set value to 0, verified the UI threw an exception immediately. - Set value back to 30, browsed around a bunch of pages. Reviewers: chad Reviewed By: chad Maniphest Tasks: T10849 Differential Revision: https://secure.phabricator.com/D15799
This commit is contained in:
parent
2c870bad86
commit
0630fef9fc
1 changed files with 6 additions and 0 deletions
|
@ -75,6 +75,12 @@ abstract class PhabricatorLiskDAO extends LiskDAO {
|
|||
$connection->setReadOnly(true);
|
||||
}
|
||||
|
||||
// Unless this is a script running from the CLI, prevent any query from
|
||||
// running for more than 30 seconds. See T10849 for discussion.
|
||||
if (php_sapi_name() != 'cli') {
|
||||
$connection->setQueryTimeout(30);
|
||||
}
|
||||
|
||||
return $connection;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue