X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Flibs%2Frdbms%2Flbfactory%2FLBFactory.php;h=1612f41dca3b89d875cddecb9f305a5c4c108f51;hp=e47e75e1781f90d074d18084714939e6a9698984;hb=71badb429e6601ceb023adac896290498fdea921;hpb=7ca601fd08e9abf7f36ec13164742e143e8efd3f diff --git a/includes/libs/rdbms/lbfactory/LBFactory.php b/includes/libs/rdbms/lbfactory/LBFactory.php index e47e75e178..1612f41dca 100644 --- a/includes/libs/rdbms/lbfactory/LBFactory.php +++ b/includes/libs/rdbms/lbfactory/LBFactory.php @@ -135,6 +135,7 @@ abstract class LBFactory implements ILBFactory { 'IPAddress' => $_SERVER[ 'REMOTE_ADDR' ] ?? '', 'UserAgent' => $_SERVER['HTTP_USER_AGENT'] ?? '', // Headers application can inject via LBFactory::setRequestInfo() + 'ChronologyProtection' => null, 'ChronologyClientId' => null, // prior $cpClientId value from LBFactory::shutdown() 'ChronologyPositionIndex' => null // prior $cpIndex value from LBFactory::shutdown() ]; @@ -374,7 +375,7 @@ abstract class LBFactory implements ILBFactory { $opts += [ 'domain' => false, 'cluster' => false, - 'timeout' => $this->cliMode ? 60 : 10, + 'timeout' => $this->cliMode ? 60 : 1, 'ifWritesSince' => null ]; @@ -431,13 +432,7 @@ abstract class LBFactory implements ILBFactory { } } - if ( $failed ) { - throw new DBReplicationWaitError( - null, - "Could not wait for replica DBs to catch up to " . - implode( ', ', $failed ) - ); - } + return !$failed; } public function setWaitForReplicationListener( $name, callable $callback = null ) { @@ -477,12 +472,13 @@ abstract class LBFactory implements ILBFactory { } $this->commitMasterChanges( $fnameEffective ); - $this->waitForReplication( $opts ); + $waitSucceeded = $this->waitForReplication( $opts ); // If a nested caller committed on behalf of $fname, start another empty $fname // transaction, leaving the caller with the same empty transaction state as before. if ( $fnameEffective !== $fname ) { $this->beginMasterChanges( $fnameEffective ); } + return $waitSucceeded; } public function getChronologyProtectorTouched( $dbName ) { @@ -732,8 +728,3 @@ abstract class LBFactory implements ILBFactory { $this->destroy(); } } - -/** - * @deprecated since 1.29 - */ -class_alias( LBFactory::class, 'LBFactory' );