Page MenuHomePhabricator

Introduce alphabetic pager for Special:EditWatchlist
Closed, DuplicatePublic

Description

Special:EditWatchlist fatal timeout from array_search() in oojs-ui/php/Tag.php

I get timeouts (i.e. “entire web request took longer than 60 seconds and timed out” Wikimedia Error page) when I try to load Special:EditWatchlist on huwiki or Wikidata (both would contain 6-7k entries; Commons with 5k pages loaded in 35-40 seconds). Another huwiki user reported that they get “request has exceeded memory limit” error on Special:EditWatchlist/raw on huwiki; the two may or may not have the same root issue. (The raw watchlist works for me on all three above-mentioned wikis.)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 5 2019, 9:35 PM
Krinkle added a subscriber: Krinkle.

Last 30 days exceptions/fatal on SpecialEditWatchlist:

  • 447 hits from 1.33-wmf.23 (this week).
  • 385 hits from 1.33-wmf.22 (last week).
  • 45 hits from 1.33-wmf.21 (until March 21).
  • 34 hits from 1.33-wmf.20 (until March 13).

Seems to be getting worse.

The older exceptions are a bit scattered from various different code areas. This is expected normally as watchlists can be quite large and of varying sizes, which means it'll time out at different points.

The ones from 1.33-wmf.22 and later, however, are more frequent with most of them coming from the exact same line of code, which calls array_search(). The line in question might be itself causing the timeout given it doesn't seem to vary between users where it times out.

A sample from Logstash:

  • Request ID: XKfjcApAADwAABkIbMEAAAAT
  • Request URL: /wiki/Special:EditWatchlist (enwiki, commonswiki, frwiki, dewiki, …)
message
PHP Fatal Error: entire web request took longer than 60 seconds and timed out

[{exception_id}] {exception_url}   PHP Fatal Error from line 186 of /srv/mediawiki/php-1.33.0-wmf.23/vendor/oojs/oojs-ui/php/Tag.php: entire web request took longer than 60 seconds and timed out
trace
#0 /srv/mediawiki/php-1.33.0-wmf.23/vendor/oojs/oojs-ui/php/Tag.php(186): array_search()
#1 /srv/mediawiki/php-1.33.0-wmf.23/vendor/oojs/oojs-ui/php/Tag.php(218): OOUI\Tag->removeContent(array)
#2 /srv/mediawiki/php-1.33.0-wmf.23/vendor/oojs/oojs-ui/php/widgets/CheckboxMultiselectInputWidget.php(127): OOUI\Tag->appendContent(OOUI\FieldLayout)
#3 /srv/mediawiki/php-1.33.0-wmf.23/vendor/oojs/oojs-ui/php/widgets/CheckboxMultiselectInputWidget.php(46): OOUI\CheckboxMultiselectInputWidget->setOptions(array)
#4 /srv/mediawiki/php-1.33.0-wmf.23/includes/htmlform/fields/HTMLMultiSelectField.php(190): OOUI\CheckboxMultiselectInputWidget->__construct(array)
#5 /srv/mediawiki/php-1.33.0-wmf.23/includes/htmlform/HTMLFormField.php(581): HTMLMultiSelectField->getInputOOUI(array)
#6 /srv/mediawiki/php-1.33.0-wmf.23/includes/htmlform/HTMLForm.php(1668): HTMLFormField->getOOUI(array)
#7 /srv/mediawiki/php-1.33.0-wmf.23/includes/specials/forms/EditWatchlistNormalHTMLForm.php(36): HTMLForm->displaySection(array, string, string, boolean)
#8 /srv/mediawiki/php-1.33.0-wmf.23/includes/htmlform/HTMLForm.php(1688): EditWatchlistNormalHTMLForm->displaySection(array, string, string, boolean)
#9 /srv/mediawiki/php-1.33.0-wmf.23/includes/specials/forms/EditWatchlistNormalHTMLForm.php(36): HTMLForm->displaySection(array, string, string, boolean)
#10 /srv/mediawiki/php-1.33.0-wmf.23/includes/htmlform/HTMLForm.php(1250): EditWatchlistNormalHTMLForm->displaySection(array, string)
#11 /srv/mediawiki/php-1.33.0-wmf.23/includes/htmlform/OOUIHTMLForm.php(250): HTMLForm->getBody()
#12 /srv/mediawiki/php-1.33.0-wmf.23/includes/htmlform/HTMLForm.php(1040): OOUIHTMLForm->getBody()
#13 /srv/mediawiki/php-1.33.0-wmf.23/includes/htmlform/HTMLForm.php(1019): HTMLForm->getHTML(boolean)
#14 /srv/mediawiki/php-1.33.0-wmf.23/includes/htmlform/HTMLForm.php(573): HTMLForm->displayForm(boolean)
#15 /srv/mediawiki/php-1.33.0-wmf.23/includes/specials/SpecialEditWatchlist.php(157): HTMLForm->show()
#16 /srv/mediawiki/php-1.33.0-wmf.23/includes/specials/SpecialEditWatchlist.php(130): SpecialEditWatchlist->executeViewEditWatchlist()
#17 /srv/mediawiki/php-1.33.0-wmf.23/includes/specialpage/SpecialPage.php(569): SpecialEditWatchlist->execute(boolean)
#18 /srv/mediawiki/php-1.33.0-wmf.23/includes/specialpage/SpecialPageFactory.php(558): SpecialPage->run(NULL)
#19 /srv/mediawiki/php-1.33.0-wmf.23/includes/MediaWiki.php(288): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
#20 /srv/mediawiki/php-1.33.0-wmf.23/includes/MediaWiki.php(867): MediaWiki->performRequest()
#21 /srv/mediawiki/php-1.33.0-wmf.23/includes/MediaWiki.php(517): MediaWiki->main()
#22 /srv/mediawiki/php-1.33.0-wmf.23/index.php(42): MediaWiki->run()
Restricted Application added a project: Growth-Team. · View Herald TranscriptApr 5 2019, 11:31 PM

Tagging both Watchlist and OOUI as I'm not sure whether it's a perf regression in OOUI itself, or potentially with the way it is used.

Krinkle renamed this task from Timeouts and memory limit errors on watchlists to Special:EditWatchlist fatal timeout from array_search() in oojs-ui/php/Tag.php.Apr 5 2019, 11:32 PM
kostajh added a subscriber: kostajh.Apr 9 2019, 7:33 PM

Perhaps it would be reasonable to limit the max number of items rendered on Special:EditWatchlist, and point users to Special:EditWatchlist/raw for modifying larger watchlists. Although this bug report says timeouts happen on Special:EditWatchlist/raw, locally with a 2,470 item watchlist, the memory usage for that page is 8.77 MB while for Special:EditWatchlist it's 74.05 MB.

Although this bug report says timeouts happen on Special:EditWatchlist/raw

Timeouts happened on Special:EditWatchlist. The raw editor had memory limit error (but the affected user blanked their watchlist in the meantime, making the error irreproducible).

Change 502803 had a related patch set uploaded (by Kosta Harlan; owner: Kosta Harlan):
[mediawiki/core@master] (wip) Limit max number of watchlist items on EditWatchlist

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

kostajh claimed this task.Apr 11 2019, 6:29 PM
kostajh added subscribers: SBisson, Catrope.

Plan as discussed with @Catrope and @SBisson:

  1. Implement a pager that respects the groupings displayed on EditWatchlist. Max number of items rendered per page would be 500.
  2. Add a namespace filter at the top of the page which defaults to "(all)"

Change 502803 abandoned by Kosta Harlan:
(wip) Limit max number of watchlist items on EditWatchlist

Reason:
will try approach from https://phabricator.wikimedia.org/T220245#5105062

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

Sounds like the same reason as for T216877 (too many entries for special page without pagianation)

Change 505784 had a related patch set uploaded (by Kosta Harlan; owner: Kosta Harlan):
[mediawiki/core@master] Introduce alphabetic pager for Special:EditWatchlist

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

JTannerWMF reassigned this task from kostajh to Catrope.Jun 12 2019, 5:50 PM
kostajh renamed this task from Special:EditWatchlist fatal timeout from array_search() in oojs-ui/php/Tag.php to Introduce alphabetic pager for Special:EditWatchlist.Jun 12 2019, 5:55 PM
kostajh added a project: User-notice.
kostajh updated the task description. (Show Details)

The solution proposed in the patch for this task is to implement an alphabetic pager for Special:EditWatchlist. The pager will respect the namespace groupings currently on EditWatchlist, but the maximum number of items rendered per page will be 500 (as opposed to the unlimited number currently). Also, the TOC at the top of EditWatchlist is replaced with a namespace filter, which defaults to (all).

Johan added a subscriber: Johan.EditedJun 13 2019, 3:05 PM

@kostajh: Thanks! But it's not yet decided this will go into production? (If it is: do you know when?)

@Johan, sorry I don't know, it depends if/when the patch is merged. @Trizek-WMF suggested that we apply the tag now anyway since we know that if merged, it's a user-noticeable worthy task.

OK! Please just move it to the "Announce in next Tech/News" column on the user-notice board when it's ready to be announced. (:

Izno added a subscriber: Izno.Jun 21 2019, 7:38 PM
daniel triaged this task as Normal priority.Aug 22 2019, 7:55 AM
Qgil removed a subscriber: Qgil.Aug 22 2019, 10:07 AM
mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:07 PM