From efde278c82435c9daf969ec1484731a5c8005ef5 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 25 Nov 2014 17:10:46 -0800 Subject: [PATCH] Log backtraces for DB reconnections Change-Id: Ibe7badde80bf6a44e292b89fe6c085cbda5748e2 --- includes/db/Database.php | 5 +++++ 1 file changed, 5 insertions(+) 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", ' ' ); -- 2.20.1