From: Evan Prodromou Date: Sat, 26 Nov 2011 14:54:41 +0000 (-0500) Subject: die when we get a bad connection error X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8cdbef098bf0a5057619ced522f8b2e63d78fbc1;p=quix0rs-gnu-social.git die when we get a bad connection error --- diff --git a/lib/framework.php b/lib/framework.php index 4458313eb9..5d163547f7 100644 --- a/lib/framework.php +++ b/lib/framework.php @@ -160,6 +160,15 @@ function PEAR_ErrorToPEAR_Exception($err) common_log(LOG_ERR, "PEAR Error: $msg ($userInfo)"); + // HACK: queue handlers get kicked by the long-query killer, and + // keep the same broken connection. We die here to get a new + // process started. + + if (php_sapi_name() == 'cli' && preg_match('/nativecode=2006/', $msg)) { + common_log(LOG_ERR, "Lost DB connection; dying."); + exit(100); + } + if ($err->getCode()) { throw new PEAR_Exception($msg, $err, $err->getCode()); } else {