jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/390238 )
Change subject: Remove unused "lock-grace-interval" option from
dispatchChanges.php
......................................................................
Remove unused "lock-grace-interval" option from dispatchChanges.php
Note that the documentation (!) of the option even says this is dead,
unused code. Can we please remove it? It can later be restored from the
git history if it is really needed.
Depends-On: I5b97c3ebb7a085c075d1192326e4c73cfcdaed6c
Change-Id: I2772494cc422123081e76b9c21d4ec09fc940c51
---
M repo/includes/Store/Sql/SqlChangeDispatchCoordinator.php
M repo/maintenance/dispatchChanges.php
M repo/tests/phpunit/includes/Store/Sql/SqlChangeDispatchCoordinatorTest.php
M repo/tests/testDispatchCoordinator.php
4 files changed, 1 insertion(+), 24 deletions(-)
Approvals:
Hoo man: Looks good to me, but someone else must approve
Addshore: Looks good to me, approved
jenkins-bot: Verified
diff --git a/repo/includes/Store/Sql/SqlChangeDispatchCoordinator.php
b/repo/includes/Store/Sql/SqlChangeDispatchCoordinator.php
index 0a54448..f57afbd 100644
--- a/repo/includes/Store/Sql/SqlChangeDispatchCoordinator.php
+++ b/repo/includes/Store/Sql/SqlChangeDispatchCoordinator.php
@@ -59,12 +59,6 @@
private $dispatchInterval = 60;
/**
- * @var int Number of seconds to wait before testing a lock. Any target
with a lock
- * timestamp newer than this will not be considered for
selection.
- */
- private $lockGraceInterval = 60;
-
- /**
* @var int Number of target wikis to select as a base set for random
selection.
* Setting this to 1 causes strict "oldest first" behavior,
with the possibility
* of grind/starvation if dispatching to the oldest wiki
fails.
@@ -146,18 +140,6 @@
*/
public function setRandomness( $randomness ) {
$this->randomness = $randomness;
- }
-
- /**
- * Sets the number of seconds after a lock should be challenged. This
should be at least twice
- * as long as we expect a dispatch pass for a single wiki to take.
Challenging locks after a
- * while safeguards against starving clients that were locked but never
unlocked by a process
- * that has since died.
- *
- * @param int $lockGraceInterval
- */
- public function setLockGraceInterval( $lockGraceInterval ) {
- $this->lockGraceInterval = $lockGraceInterval;
}
/**
diff --git a/repo/maintenance/dispatchChanges.php
b/repo/maintenance/dispatchChanges.php
index 973ffa2..d296672 100644
--- a/repo/maintenance/dispatchChanges.php
+++ b/repo/maintenance/dispatchChanges.php
@@ -51,8 +51,6 @@
$this->addOption( 'idle-delay', "Seconds to sleep when idle.
Default: 10", false, true );
$this->addOption( 'dispatch-interval', "How often to dispatch
to each target wiki. "
. "Default: every 60 seconds", false,
true );
- $this->addOption( 'lock-grace-interval', "Seconds after which
to probe for orphaned locks."
- . "Default: 60. NOTE: Currently this
has no effect!", false, true );
$this->addOption( 'randomness', "Number of least current target
wikis to pick from at random. "
. "Default: 15.", false, true );
$this->addOption( 'max-passes', "The number of passes to
perform. "
@@ -107,6 +105,7 @@
* @param string[] $allClientWikis as returned by getClientWikis().
* @param string[]|null $selectedSiteIDs site IDs to select, or null to
disable filtering.
*
+ * @throws MWException
* @return string[] A mapping of client wiki site IDs to logical
database names.
*/
private function filterClientWikis( array $allClientWikis, array
$selectedSiteIDs = null ) {
@@ -153,7 +152,6 @@
$batchSize = (int)$this->getOption( 'batch-size', 1000 );
$maxChunks = (int)$this->getOption( 'max-chunks', 15 );
$dispatchInterval = (int)$this->getOption( 'dispatch-interval',
60 );
- $lockGraceInterval = (int)$this->getOption(
'lock-grace-interval', 60 );
$randomness = (int)$this->getOption( 'randomness', 15 );
$this->verbose = $this->getOption( 'verbose', false );
@@ -173,7 +171,6 @@
$coordinator->setMessageReporter( $reporter );
$coordinator->setBatchSize( $batchSize );
$coordinator->setDispatchInterval( $dispatchInterval );
- $coordinator->setLockGraceInterval( $lockGraceInterval );
$coordinator->setRandomness( $randomness );
$notificationSender = new JobQueueChangeNotificationSender(
$repoDB, $clientWikis );
diff --git
a/repo/tests/phpunit/includes/Store/Sql/SqlChangeDispatchCoordinatorTest.php
b/repo/tests/phpunit/includes/Store/Sql/SqlChangeDispatchCoordinatorTest.php
index 8db1c3a..23a9504 100644
--- a/repo/tests/phpunit/includes/Store/Sql/SqlChangeDispatchCoordinatorTest.php
+++ b/repo/tests/phpunit/includes/Store/Sql/SqlChangeDispatchCoordinatorTest.php
@@ -34,7 +34,6 @@
$coordinator->setBatchSize( 3 );
$coordinator->setRandomness( 3 );
- $coordinator->setLockGraceInterval( 120 );
$coordinator->setDispatchInterval( 60 );
$coordinator->setArrayRandOverride( function( $array ) {
diff --git a/repo/tests/testDispatchCoordinator.php
b/repo/tests/testDispatchCoordinator.php
index fca7a98..399093d 100644
--- a/repo/tests/testDispatchCoordinator.php
+++ b/repo/tests/testDispatchCoordinator.php
@@ -106,7 +106,6 @@
}
$coordinator->setChangesTable( self::TABLE_PREFIX .
'wb_changes' );
$coordinator->setStateTable( self::TABLE_PREFIX .
'wb_changes_dispatch' );
- $coordinator->setLockGraceInterval( 2 );
$coordinator->setDispatchInterval( 2 );
return $coordinator;
--
To view, visit https://gerrit.wikimedia.org/r/390238
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I2772494cc422123081e76b9c21d4ec09fc940c51
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Hoo man <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits