Page MenuHomePhabricator

CentralNotice: Saving banners with translatable messages may time out
Open, Needs TriagePublic0 Story Points

Description

It seems this started happening sometime in April.

See this logstash.

Stack trace:

#0 /srv/mediawiki/php-1.34.0-wmf.1/extensions/Translate/utils/TranslateMetadata.php(23): NO_FUNCTION_GIVEN()
#1 /srv/mediawiki/php-1.34.0-wmf.1/extensions/Translate/utils/TranslateMetadata.php(43): TranslateMetadata::preloadGroups()
#2 /srv/mediawiki/php-1.34.0-wmf.1/extensions/Translate/TranslateHooks.php(641): TranslateMetadata::get(string, string)
#3 /srv/mediawiki/php-1.34.0-wmf.1/includes/Hooks.php(174): TranslateHooks::hideRestrictedFromStats(string, string)
#4 /srv/mediawiki/php-1.34.0-wmf.1/includes/Hooks.php(202): Hooks::callHook(string, array, array, NULL)
#5 /srv/mediawiki/php-1.34.0-wmf.1/extensions/Translate/utils/MessageGroupStats.php(502): Hooks::run(string, array)
#6 /srv/mediawiki/php-1.34.0-wmf.1/extensions/Translate/utils/MessageGroupStats.php(443): MessageGroupStats::calculateAggregageGroup(array, AggregateMessageGroup, string, integer)
#7 /srv/mediawiki/php-1.34.0-wmf.1/extensions/Translate/utils/MessageGroupStats.php(198): MessageGroupStats::forItemInternal(array, AggregateMessageGroup, string, integer)
#8 /srv/mediawiki/php-1.34.0-wmf.1/extensions/Translate/utils/MessageGroupStats.php(184): MessageGroupStats::internalClearGroups(string, array)
#9 /srv/mediawiki/php-1.34.0-wmf.1/extensions/Translate/utils/MessageIndex.php(278): MessageGroupStats::clearGroup(array)
#10 /srv/mediawiki/php-1.34.0-wmf.1/extensions/Translate/utils/MessageIndex.php(197): MessageIndex->clearMessageGroupStats(array)
#11 /srv/mediawiki/php-1.34.0-wmf.1/extensions/Translate/utils/MessageIndexRebuildJob.php(36): MessageIndex->rebuild()
#12 /srv/mediawiki/php-1.34.0-wmf.1/extensions/CentralNotice/includes/Banner.php(1019): MessageIndexRebuildJob->run()
#13 /srv/mediawiki/php-1.34.0-wmf.1/extensions/CentralNotice/special/SpecialCentralNoticeBanners.php(1001): Banner->save(User, string)
#14 /srv/mediawiki/php-1.34.0-wmf.1/extensions/CentralNotice/special/SpecialCentralNoticeBanners.php(946): SpecialCentralNoticeBanners->processSaveBannerAction(array)
#15 /srv/mediawiki/php-1.34.0-wmf.1/includes/htmlform/HTMLForm.php(675): SpecialCentralNoticeBanners->processEditBanner(array, CentralNoticeHtmlForm)
#16 /srv/mediawiki/php-1.34.0-wmf.1/includes/htmlform/HTMLForm.php(567): HTMLForm->trySubmit()
#17 /srv/mediawiki/php-1.34.0-wmf.1/extensions/CentralNotice/special/SpecialCentralNoticeBanners.php(442): HTMLForm->tryAuthorizedSubmit()
#18 /srv/mediawiki/php-1.34.0-wmf.1/extensions/CentralNotice/special/SpecialCentralNoticeBanners.php(91): SpecialCentralNoticeBanners->showBannerEditor()
#19 /srv/mediawiki/php-1.34.0-wmf.1/includes/specialpage/SpecialPage.php(569): SpecialCentralNoticeBanners->execute(string)
#20 /srv/mediawiki/php-1.34.0-wmf.1/includes/specialpage/SpecialPageFactory.php(578): SpecialPage->run(string)
#21 /srv/mediawiki/php-1.34.0-wmf.1/includes/MediaWiki.php(288): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
#22 /srv/mediawiki/php-1.34.0-wmf.1/includes/MediaWiki.php(865): MediaWiki->performRequest()
#23 /srv/mediawiki/php-1.34.0-wmf.1/includes/MediaWiki.php(515): MediaWiki->main()
#24 /srv/mediawiki/php-1.34.0-wmf.1/index.php(42): MediaWiki->run()
#25 /srv/mediawiki/w/index.php(3): include(string)
#26 {main}

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 29 2019, 3:31 PM
Ejegg added a subscriber: Ejegg.May 29 2019, 3:48 PM

Potentially related commit (deployed a couple weeks before first instance of this bug, touches the relevant code): rETRAb1b777818ba1b555d03527e5865e59aa2b427dd7

It looks like MessageIndexRebuildJob is being run in-request, also rebuilding caches in request. I'd rather have that deferred to the JobQueue. I also think there is something weird going on there which causes invalidation for lots of message groups. Something like this has been happening for years (see previous bugs) and we need to add better instrumentation to confirm/disconfirm this.

Jseddon added a subscriber: Jseddon.Jun 3 2019, 3:49 AM

Today just adding two new messages to a new banner must have taken 5-6 attempts.