Page MenuHomePhabricator

WatchedItemStore::addWatchBatchForUser does not have outer scope.
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error

Request ID: AWatW9nHN-apXXYuZSe6

message
Wikimedia\Rdbms\LBFactory::commitAndWaitForReplication: WatchedItemStore::addWatchBatchForUser does not have outer scope.
trace
#0 /srv/mediawiki/php-1.33.0-wmf.1/includes/watcheditem/WatchedItemStore.php(744): Wikimedia\Rdbms\LBFactory->getEmptyTransactionTicket()
#1 /srv/mediawiki/php-1.33.0-wmf.1/includes/user/User.php(3935): WatchedItemStore->addWatchBatchForUser()
#2 /srv/mediawiki/php-1.33.0-wmf.1/includes/actions/WatchAction.php(128): User->addWatch()
#3 /srv/mediawiki/php-1.33.0-wmf.1/includes/upload/UploadBase.php(877): WatchAction::doWatch()
#4 /srv/mediawiki/php-1.33.0-wmf.1/includes/api/ApiUpload.php(828): UploadBase->performUpload()
#5 /srv/mediawiki/php-1.33.0-wmf.1/includes/api/ApiUpload.php(146): ApiUpload->performUpload()
#6 /srv/mediawiki/php-1.33.0-wmf.1/includes/api/ApiUpload.php(104): ApiUpload->getContextResult()
#7 /srv/mediawiki/php-1.33.0-wmf.1/includes/api/ApiMain.php(1570): ApiUpload->execute()
#8 /srv/mediawiki/php-1.33.0-wmf.1/includes/api/ApiMain.php(531): ApiMain->executeAction()
#9 /srv/mediawiki/php-1.33.0-wmf.1/includes/api/ApiMain.php(502): ApiMain->executeActionWithErrorHandling()
#10 /srv/mediawiki/php-1.33.0-wmf.1/api.php(87): ApiMain->execute()
#11 /srv/mediawiki/w/api.php(3): include()
#12 {main}

#0 /srv/mediawiki/php-1.33.0-wmf.1/includes/watcheditem/WatchedItemStore.php(752): Wikimedia\Rdbms\LBFactory->commitAndWaitForReplication()
#1 /srv/mediawiki/php-1.33.0-wmf.1/includes/user/User.php(3935): WatchedItemStore->addWatchBatchForUser()
#2 /srv/mediawiki/php-1.33.0-wmf.1/includes/actions/WatchAction.php(128): User->addWatch()
#3 /srv/mediawiki/php-1.33.0-wmf.1/extensions/Wikibase/repo/includes/Store/Sql/WikiPageEntityStore.php(480): WatchAction::doWatch()
#4 /srv/mediawiki/php-1.33.0-wmf.1/extensions/Wikibase/lib/includes/Store/TypeDispatchingEntityStore.php(154): Wikibase\Repo\Store\WikiPageEntityStore->updateWatchlist()
#5 /srv/mediawiki/php-1.33.0-wmf.1/extensions/Wikibase/repo/includes/EditEntity.php(810): Wikibase\Lib\Store\TypeDispatchingEntityStore->updateWatchlist()
#6 /srv/mediawiki/php-1.33.0-wmf.1/extensions/Wikibase/repo/includes/EditEntity.php(759): Wikibase\EditEntity->updateWatchlist()
#7 /srv/mediawiki/php-1.33.0-wmf.1/extensions/Wikibase/repo/includes/Api/EntitySavingHelper.php(351): Wikibase\EditEntity->attemptSave()
#8 /srv/mediawiki/php-1.33.0-wmf.1/extensions/Wikibase/repo/includes/Api/ModifyEntity.php(310): Wikibase\Repo\Api\EntitySavingHelper->attemptSaveEntity()
#9 /srv/mediawiki/php-1.33.0-wmf.1/includes/api/ApiMain.php(1570): Wikibase\Repo\Api\ModifyEntity->execute()
#10 /srv/mediawiki/php-1.33.0-wmf.1/includes/api/ApiMain.php(531): ApiMain->executeAction()
#11 /srv/mediawiki/php-1.33.0-wmf.1/includes/api/ApiMain.php(502): ApiMain->executeActionWithErrorHandling()
#12 /srv/mediawiki/php-1.33.0-wmf.1/api.php(87): ApiMain->execute()
#13 /srv/mediawiki/w/api.php(3): include()
#14 {main}

Impact

Notes

In both the DBPerformance and DBQuery logs, not fatal.

Probably caused by https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/464029/

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Does this really need to call commitAndWaitForReplication() when there is only one batch? Is it ever called thousands of times in a row?

There is also the, I guess related:

Wikimedia\Rdbms\LBFactory::getEmptyTransactionTicket: WatchedItemStore::removeWatchBatchForUser does not have outer scope. #0 /srv/mediawiki/php-1.33.0-wmf.1/includes/watcheditem/WatchedItemStore.php(392): Wikimedia\Rdbms\LBFactory->getEmptyTransactionTic

Change 471806 had a related patch set uploaded (by Kosta Harlan; owner: Kosta Harlan):
[mediawiki/core@master] Use commit-and-wait when processing more than updateRowsPerQuery

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

Does this really need to call commitAndWaitForReplication() when there is only one batch? Is it ever called thousands of times in a row?

@aaron This can happen if you edit raw watchlist and add/remove several thousand items. I added you to the patch for review.

Change 471806 merged by jenkins-bot:
[mediawiki/core@master] Use commit-and-wait when processing more than updateRowsPerQuery

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

mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:08 PM