From: Evan Prodromou Date: Fri, 2 Dec 2011 20:45:01 +0000 (-0500) Subject: Merge branch 'master' of gitorious.org:statusnet/mainline into 1.1.x X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5365ffc7d0c2c609b7ea576a5608f8aa3ea8b726;p=quix0rs-gnu-social.git Merge branch 'master' of gitorious.org:statusnet/mainline into 1.1.x --- 5365ffc7d0c2c609b7ea576a5608f8aa3ea8b726 diff --cc lib/framework.php index 69c1e4f6c8,e7a1829bc6..8f5cdf31c6 --- a/lib/framework.php +++ b/lib/framework.php @@@ -159,10 -160,20 +159,19 @@@ function PEAR_ErrorToPEAR_Exception($er 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/', $userInfo)) { + common_log(LOG_ERR, "Lost DB connection; dying."); + exit(100); + } + if ($err->getCode()) { - throw new PEAR_Exception($msg, $err, $err->getCode()); - } else { - throw new PEAR_Exception($msg, $err); + throw new PEAR_Exception($err->getMessage(), $err->getCode()); } + throw new PEAR_Exception($err->getMessage()); } PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'PEAR_ErrorToPEAR_Exception');