From: Aaron Schulz Date: Wed, 26 Nov 2014 01:10:46 +0000 (-0800) Subject: Log backtraces for DB reconnections X-Git-Tag: 1.31.0-rc.0~13103 X-Git-Url: http://git.cyclocoop.org/%22%20.%20%20%20%24self2%20.%20%20%20%22&var_mode_affiche=boucle?a=commitdiff_plain;h=efde278c82435c9daf969ec1484731a5c8005ef5;p=lhc%2Fweb%2Fwiklou.git Log backtraces for DB reconnections Change-Id: Ibe7badde80bf6a44e292b89fe6c085cbda5748e2 --- diff --git a/includes/db/Database.php b/includes/db/Database.php index 11246172bd..df04b6d98e 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -1028,7 +1028,12 @@ abstract class DatabaseBase implements IDatabase { $lastErrno = $this->lastErrno(); if ( $this->ping() ) { global $wgRequestTime; + wfDebug( "Reconnected\n" ); + $server = $this->getServer(); + $msg = __METHOD__ . ": lost connection to $server; reconnected"; + wfDebugLog( 'DBPerformance', "$msg:\n" . wfBacktrace( true ) ); + $sqlx = $wgDebugDumpSqlLength ? substr( $commentedSql, 0, $wgDebugDumpSqlLength ) : $commentedSql; $sqlx = strtr( $sqlx, "\t\n", ' ' );