r41091 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41090‎ | r41091 | r41092 >
Date:08:28, 21 September 2008
Author:tstarling
Status:old
Tags:
Comment:
Logging tweaks
Modified paths:
  • /trunk/phase3/includes/db/Database.php (modified) (history)
  • /trunk/phase3/includes/db/LoadBalancer.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/db/Database.php
@@ -376,24 +376,21 @@
377377 $error = $phpError;
378378 }
379379 wfLogDBError( "Error connecting to {$this->mServer}: $error\n" );
 380+ wfDebug( "DB connection error\n" );
 381+ wfDebug( "Server: $server, User: $user, Password: " .
 382+ substr( $password, 0, 3 ) . "..., error: " . mysql_error() . "\n" );
 383+ $success = false;
380384 }
381385
382386 wfProfileOut("dbconnect-$server");
383387
384 - if ( $dbName != '' ) {
385 - if ( $this->mConn !== false ) {
386 - $success = @/**/mysql_select_db( $dbName, $this->mConn );
387 - if ( !$success ) {
388 - $error = "Error selecting database $dbName on server {$this->mServer} " .
389 - "from client host {$wguname['nodename']}\n";
390 - wfLogDBError(" Error selecting database $dbName on server {$this->mServer} \n");
391 - wfDebug( $error );
392 - }
393 - } else {
394 - wfDebug( "DB connection error\n" );
395 - wfDebug( "Server: $server, User: $user, Password: " .
396 - substr( $password, 0, 3 ) . "..., error: " . mysql_error() . "\n" );
397 - $success = false;
 388+ if ( $dbName != '' && $this->mConn !== false ) {
 389+ $success = @/**/mysql_select_db( $dbName, $this->mConn );
 390+ if ( !$success ) {
 391+ $error = "Error selecting database $dbName on server {$this->mServer} " .
 392+ "from client host {$wguname['nodename']}\n";
 393+ wfLogDBError(" Error selecting database $dbName on server {$this->mServer} \n");
 394+ wfDebug( $error );
398395 }
399396 } else {
400397 # Delay USE query
Index: trunk/phase3/includes/db/LoadBalancer.php
@@ -663,6 +663,7 @@
664664 $reporting = true;
665665 if ( !is_object( $conn ) ) {
666666 // No last connection, probably due to all servers being too busy
 667+ wfLogDBError( "LB failure with no last connection\n" );
667668 $conn = new Database;
668669 if ( $this->mFailFunction ) {
669670 $conn->failFunction( $this->mFailFunction );
@@ -678,6 +679,7 @@
679680 $conn->failFunction( false );
680681 }
681682 $server = $conn->getProperty( 'mServer' );
 683+ wfLogDBError( "Connection error: {$this->mLastError} ({$server})\n" );
682684 $conn->reportConnectionError( "{$this->mLastError} ({$server})" );
683685 }
684686 $reporting = false;

Follow-up revisions

RevisionCommit summaryAuthorDate
r41234Revert some recent ES-related changes -- they made behavior much worse when w...brion18:09, 24 September 2008