From 324dd3c0d617867c9e373d9236353b10179775b5 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Fri, 5 Apr 2013 22:42:27 -0700 Subject: [PATCH] Reduce wait_timeout to max. allowed value Summary: http://dev.mysql.com/doc/mysql/en/server-system-variables.html#sysvar_wait_timeout Test Plan: $ arc unit Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D5590 --- src/infrastructure/util/PhabricatorGlobalLock.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/infrastructure/util/PhabricatorGlobalLock.php b/src/infrastructure/util/PhabricatorGlobalLock.php index 54e3c2d1d8..349c7f6531 100644 --- a/src/infrastructure/util/PhabricatorGlobalLock.php +++ b/src/infrastructure/util/PhabricatorGlobalLock.php @@ -78,8 +78,9 @@ final class PhabricatorGlobalLock extends PhutilLock { // NOTE: Since MySQL will disconnect us if we're idle for too long, we set // the wait_timeout to an enormous value, to allow us to hold the - // connection open indefinitely (or, at least, for a year). - queryfx($conn, 'SET wait_timeout = %d', 365 * 24 * 60 * 60); + // connection open indefinitely (or, at least, for 24 days). + $max_allowed_timeout = 2147483; + queryfx($conn, 'SET wait_timeout = %d', $max_allowed_timeout); } $result = queryfx_one(