Added a separate error message for mkdir failures
[lhc/web/wiklou.git] / includes / db / loadbalancer / LBFactoryMulti.php
index 089dfd3..39be996 100644 (file)
@@ -76,8 +76,6 @@
  * @ingroup Database
  */
 class LBFactoryMulti extends LBFactory {
-       // Required settings
-
        /** @var array A map of database names to section names */
        private $sectionsByDB;
 
@@ -160,7 +158,6 @@ class LBFactoryMulti extends LBFactory {
        public function __construct( array $conf ) {
                parent::__construct( $conf );
 
-               $this->chronProt = new ChronologyProtector;
                $this->conf = $conf;
                $required = array( 'sectionsByDB', 'sectionLoads', 'serverTemplate' );
                $optional = array( 'groupLoadsBySection', 'groupLoadsByDB', 'hostsByName',
@@ -303,7 +300,8 @@ class LBFactoryMulti extends LBFactory {
                return new LoadBalancer( array(
                        'servers' => $this->makeServerArray( $template, $loads, $groupLoads ),
                        'loadMonitor' => $this->loadMonitorClass,
-                       'readOnlyReason' => $readOnlyReason
+                       'readOnlyReason' => $readOnlyReason,
+                       'trxProfiler' => $this->trxProfiler
                ) );
        }
 
@@ -401,14 +399,10 @@ class LBFactoryMulti extends LBFactory {
                }
        }
 
-       public function shutdown() {
-               foreach ( $this->mainLBs as $lb ) {
-                       $this->chronProt->shutdownLB( $lb );
-               }
-               foreach ( $this->extLBs as $extLB ) {
-                       $this->chronProt->shutdownLB( $extLB );
+       public function shutdown( $flags = 0 ) {
+               if ( !( $flags & self::SHUTDOWN_NO_CHRONPROT ) ) {
+                       $this->shutdownChronologyProtector( $this->chronProt );
                }
-               $this->chronProt->shutdown();
-               $this->commitMasterChanges();
+               $this->commitMasterChanges( __METHOD__ ); // sanity
        }
 }