Page MenuHomePhabricator

Make MediaModeration sleep on JobQueueError
Closed, ResolvedPublic1 Estimated Story Points

Description

The MediaModeration script stopped running over the weekend because of the following error:

JobQueueError from line 134 of /srv/mediawiki/php-1.42.0-wmf.25/extensions/EventBus/includes/Adapters/JobQueue/JobQueueEventBus.php:
Could not enqueue jobs
#0 /srv/mediawiki/php-1.42.0-wmf.25/includes/jobqueue/JobQueue.php(375): MediaWiki\Extension\EventBus\Adapters\JobQueue\JobQueueEventBus->doBatchPush(Array, 0)
#1 /srv/mediawiki/php-1.42.0-wmf.25/includes/jobqueue/JobQueue.php(347): JobQueue->batchPush(Array, 0)
#2 /srv/mediawiki/php-1.42.0-wmf.25/includes/jobqueue/JobQueueGroup.php(155): JobQueue->push(Array)
#3 /srv/mediawiki/php-1.42.0-wmf.25/extensions/MediaModeration/maintenance/scanFilesInScanTable.php(116): JobQueueGroup->push(Array)
#4 /srv/mediawiki/php-1.42.0-wmf.25/maintenance/includes/MaintenanceRunner.php(698): MediaWiki\Extension\MediaModeration\Maintenance\ScanFilesInScanTable->execute()
#5 /srv/mediawiki/php-1.42.0-wmf.25/maintenance/run.php(51): MediaWiki\Maintenance\MaintenanceRunner->run()
#6 /srv/mediawiki/multiversion/MWScript.php(158): require_once('/srv/mediawiki/...')
#7 {main}

When this happens, the script should be instructed to sleep and then re-try inserting jobs to avoid the script exiting due to temporary server disruptions.

Acceptance criteria
  • The scanFilesInScanTable.php script should catch thrown JobQueueError exceptions and instead sleep before re-trying an insert.

Event Timeline

Change #1017818 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/MediaModeration@master] Catch JobQueueError exceptions in scanFilesInScanTable.php

https://gerrit.wikimedia.org/r/1017818

Change #1017818 merged by jenkins-bot:

[mediawiki/extensions/MediaModeration@master] Catch JobQueueError exceptions in scanFilesInScanTable.php

https://gerrit.wikimedia.org/r/1017818

It will be hard to QA this, because it would require some specific circumstances which would not be possible to QA on beta wikis and hard to QA on test wikis.

As such, I'm proposing to skip QA.