jenkins-bot has submitted this change and it was merged.
Change subject: Fix shutdown() code duplication in LBFactory
......................................................................
Fix shutdown() code duplication in LBFactory
Merge duplicate shutdown() methods from LBFactory subclasses
to the base class, as cronProt is also set there too.
Change-Id: I4050b3469f61b1f4173d5841ff2497f3f30e1382
---
M includes/db/loadbalancer/LBFactory.php
M includes/db/loadbalancer/LBFactoryMulti.php
M includes/db/loadbalancer/LBFactorySimple.php
3 files changed, 4 insertions(+), 15 deletions(-)
Approvals:
EBernhardson: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/db/loadbalancer/LBFactory.php
b/includes/db/loadbalancer/LBFactory.php
index f560cf1..84f7fcb 100644
--- a/includes/db/loadbalancer/LBFactory.php
+++ b/includes/db/loadbalancer/LBFactory.php
@@ -196,9 +196,12 @@
/**
* Prepare all tracked load balancers for shutdown
* @param integer $flags Supports SHUTDOWN_* flags
- * STUB
*/
public function shutdown( $flags = 0 ) {
+ if ( !( $flags & self::SHUTDOWN_NO_CHRONPROT ) ) {
+ $this->shutdownChronologyProtector( $this->chronProt );
+ }
+ $this->commitMasterChanges( __METHOD__ ); // sanity
}
/**
diff --git a/includes/db/loadbalancer/LBFactoryMulti.php
b/includes/db/loadbalancer/LBFactoryMulti.php
index 4b9cccc..f201081 100644
--- a/includes/db/loadbalancer/LBFactoryMulti.php
+++ b/includes/db/loadbalancer/LBFactoryMulti.php
@@ -418,11 +418,4 @@
call_user_func_array( $callback, array_merge( [ $lb ],
$params ) );
}
}
-
- public function shutdown( $flags = 0 ) {
- if ( !( $flags & self::SHUTDOWN_NO_CHRONPROT ) ) {
- $this->shutdownChronologyProtector( $this->chronProt );
- }
- $this->commitMasterChanges( __METHOD__ ); // sanity
- }
}
diff --git a/includes/db/loadbalancer/LBFactorySimple.php
b/includes/db/loadbalancer/LBFactorySimple.php
index 3702c8b..c7c4752 100644
--- a/includes/db/loadbalancer/LBFactorySimple.php
+++ b/includes/db/loadbalancer/LBFactorySimple.php
@@ -159,11 +159,4 @@
call_user_func_array( $callback, array_merge( [ $lb ],
$params ) );
}
}
-
- public function shutdown( $flags = 0 ) {
- if ( !( $flags & self::SHUTDOWN_NO_CHRONPROT ) ) {
- $this->shutdownChronologyProtector( $this->chronProt );
- }
- $this->commitMasterChanges( __METHOD__ ); // sanity
- }
}
--
To view, visit https://gerrit.wikimedia.org/r/307321
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I4050b3469f61b1f4173d5841ff2497f3f30e1382
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
Gerrit-Reviewer: EBernhardson <[email protected]>
Gerrit-Reviewer: Parent5446 <[email protected]>
Gerrit-Reviewer: Smalyshev <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits