Index: branches/wmf/1.17wmf1/includes/db/LoadBalancer.php |
— | — | @@ -220,7 +220,8 @@ |
221 | 221 | $i = $this->getRandomNonLagged( $currentLoads, $wiki ); |
222 | 222 | if ( $i === false && count( $currentLoads ) != 0 ) { |
223 | 223 | # All slaves lagged. Switch to read-only mode |
224 | | - $wgReadOnly = wfMsgNoDBForContent( 'readonly_lag' ); |
| 224 | + $wgReadOnly = 'The database has been automatically locked ' . |
| 225 | + 'while the slave database servers catch up to the master'; |
225 | 226 | $i = $this->pickRandom( $currentLoads ); |
226 | 227 | $laggedSlaveMode = true; |
227 | 228 | } |
— | — | @@ -650,7 +651,13 @@ |
651 | 652 | |
652 | 653 | # Create object |
653 | 654 | wfDebug( "Connecting to $host $dbname...\n" ); |
654 | | - $db = new $class( $host, $user, $password, $dbname, $flags ); |
| 655 | + try { |
| 656 | + $db = new $class( $host, $user, $password, $dbname, $flags ); |
| 657 | + } catch ( DBConnectionError $e ) { |
| 658 | + // FIXME: This is probably the ugliest thing I have ever done to |
| 659 | + // PHP. I'm half-expecting it to segfault, just out of disgust. -- TS |
| 660 | + $db = $e->db; |
| 661 | + } |
655 | 662 | if ( $db->isOpen() ) { |
656 | 663 | wfDebug( "Connected to $host $dbname.\n" ); |
657 | 664 | } else { |
Property changes on: branches/wmf/1.17wmf1/includes/db/LoadBalancer.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
658 | 665 | Merged /branches/new-installer/phase3/includes/db/LoadBalancer.php:r43664-66004 |
659 | 666 | Merged /branches/wmf-deployment/includes/db/LoadBalancer.php:r53381,60970 |
660 | 667 | Merged /branches/REL1_15/phase3/includes/db/LoadBalancer.php:r51646 |
661 | 668 | Merged /branches/wmf/1.16wmf4/includes/db/LoadBalancer.php:r67177,69199,76243,77266 |
662 | 669 | Merged /branches/REL1_17/phase3/includes/db/LoadBalancer.php:r90266 |
663 | 670 | Merged /branches/sqlite/includes/db/LoadBalancer.php:r58211-58321 |
664 | 671 | Merged /trunk/phase3/includes/db/LoadBalancer.php:r83590,89512-89513 |