r96518 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96517‎ | r96518 | r96519 >
Date:23:25, 7 September 2011
Author:reedy
Status:ok
Tags:
Comment:
Merge r96517/r90266 to REL1_18
Modified paths:
  • /branches/REL1_18/phase3/includes/db/LoadBalancer.php (modified) (history)

Diff [purge]

Index: branches/REL1_18/phase3/includes/db/LoadBalancer.php
@@ -241,7 +241,8 @@
242242 $i = $this->getRandomNonLagged( $currentLoads, $wiki );
243243 if ( $i === false && count( $currentLoads ) != 0 ) {
244244 # All slaves lagged. Switch to read-only mode
245 - $wgReadOnly = wfMessage( 'readonly_lag' )->useDatabase( false )->plain();
 245+ $wgReadOnly = 'The database has been automatically locked ' .
 246+ 'while the slave database servers catch up to the master';
246247 $i = $this->pickRandom( $currentLoads );
247248 $laggedSlaveMode = true;
248249 }
@@ -678,7 +679,14 @@
679680
680681 # Create object
681682 wfDebug( "Connecting to $host $dbname...\n" );
682 - $db = DatabaseBase::factory( $server['type'], $server );
 683+ try {
 684+ $db = DatabaseBase::factory( $server['type'], $server );
 685+ } catch ( DBConnectionError $e ) {
 686+ // FIXME: This is probably the ugliest thing I have ever done to
 687+ // PHP. I'm half-expecting it to segfault, just out of disgust. -- TS
 688+ $db = $e->db;
 689+ }
 690+
683691 if ( $db->isOpen() ) {
684692 wfDebug( "Connected to $host $dbname.\n" );
685693 } else {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r90266* (bug 29233) Temporary fix which roughly restores the 1.16 behaviour of open...tstarling12:59, 17 June 2011
r96517Merge r90266 to trunk...reedy23:21, 7 September 2011

Status & tagging log