Page MenuHomePhabricator

Unable to open Special:Undelete form on dewiki due to execution timeout
Closed, ResolvedPublicPRODUCTION ERROR

Description

Trying to view the deleted revisions of Wikipedia:Spielwiese (dewiki), which has 261,604 deleted edits as of now, is returning [XpE5jwpAAMEAATVWiLUAAAEY] 2020-04-11 03:30:19: Fatal exception of type "WMFTimeoutException"

WMFTimeoutException: the execution time limit of 60 seconds was exceeded
#0 /srv/mediawiki/php-1.35.0-wmf.27/includes/parser/Sanitizer.php(1130): {closure}(integer)
#1 /srv/mediawiki/php-1.35.0-wmf.27/includes/Html.php(553): Sanitizer::encodeAttribute(string)
#2 /srv/mediawiki/php-1.35.0-wmf.27/includes/Html.php(305): Html::expandAttributes(array)
#3 /srv/mediawiki/php-1.35.0-wmf.27/includes/Html.php(210): Html::openElement(string, array)
#4 /srv/mediawiki/php-1.35.0-wmf.27/includes/linker/LinkRenderer.php(391): Html::rawElement(string, array, string)
#5 /srv/mediawiki/php-1.35.0-wmf.27/includes/linker/LinkRenderer.php(280): MediaWiki\Linker\LinkRenderer->buildAElement(TitleValue, string, array, boolean)
#6 /srv/mediawiki/php-1.35.0-wmf.27/includes/linker/LinkRenderer.php(307): MediaWiki\Linker\LinkRenderer->makePreloadedLink(TitleValue, string, string, array, array)
#7 /srv/mediawiki/php-1.35.0-wmf.27/includes/specials/SpecialUndelete.php(1134): MediaWiki\Linker\LinkRenderer->makeKnownLink(Title, string, array, array)
#8 /srv/mediawiki/php-1.35.0-wmf.27/includes/specials/SpecialUndelete.php(1001): SpecialUndelete->getPageLink(Revision, Title, string)
#9 /srv/mediawiki/php-1.35.0-wmf.27/includes/specials/SpecialUndelete.php(928): SpecialUndelete->formatRevisionRow(stdClass, string, integer)
#10 /srv/mediawiki/php-1.35.0-wmf.27/includes/specials/SpecialUndelete.php(260): SpecialUndelete->showHistory()
#11 /srv/mediawiki/php-1.35.0-wmf.27/includes/specialpage/SpecialPage.php(575): SpecialUndelete->execute(string)
#12 /srv/mediawiki/php-1.35.0-wmf.27/includes/specialpage/SpecialPageFactory.php(618): SpecialPage->run(string)
#13 /srv/mediawiki/php-1.35.0-wmf.27/includes/MediaWiki.php(299): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#14 /srv/mediawiki/php-1.35.0-wmf.27/includes/MediaWiki.php(973): MediaWiki->performRequest()
#15 /srv/mediawiki/php-1.35.0-wmf.27/includes/MediaWiki.php(535): MediaWiki->main()
#16 /srv/mediawiki/php-1.35.0-wmf.27/index.php(47): MediaWiki->run()
#17 /srv/mediawiki/w/index.php(3): require(string)
#18 {main}

Details

Request ID
XpE5jwpAAMEAATVWiLUAAAEY
Request URL
https://de.wikipedia.org/wiki/Spezial:Wiederherstellen/Wikipedia:Spielwiese

Event Timeline

Peachey88 changed the subtype of this task from "Task" to "Production Error".Apr 11 2020, 3:36 AM

Adding Wikimedia-production-error seeing as this will show up in the logs - will need the stack trace for this exception hash from there too

I'd hazard a guess this is related to T9996, as trying to return 261604 revisions in a single request is practically guaranteed to time out.

Aklapper renamed this task from w:de:Special:Undelete/Wikipedia:Spielwiese throws WMFTimeoutException to w:de:Special:Undelete/Wikipedia:Spielwiese throws WMFTimeoutException: the execution time limit of 60 seconds was exceeded.Apr 11 2020, 7:07 AM
Aklapper set Request URL to https://de.wikipedia.org//wiki/Spezial:Wiederherstellen/Wikipedia:Spielwiese.
Aklapper set Request ID to XpE5jwpAAMEAATVWiLUAAAEY.
Aklapper edited Stack Trace. (Show Details)
Aklapper set Phatality ID to 5e7d2fda2aeafbd8fcca99321e8dbad17d36ba13157376ed7d08a18ac9bb6f75.
Krinkle renamed this task from w:de:Special:Undelete/Wikipedia:Spielwiese throws WMFTimeoutException: the execution time limit of 60 seconds was exceeded to Unable to open Restore page form dewiki, Fatal WMFTimeoutException "the execution time limit of 60 seconds was exceeded".Apr 29 2020, 6:58 PM
Krinkle updated the task description. (Show Details)
Krinkle edited Stack Trace. (Show Details)
Krinkle moved this task from Untriaged to Apr 2020 on the Wikimedia-production-error board.
Krinkle renamed this task from Unable to open Restore page form dewiki, Fatal WMFTimeoutException "the execution time limit of 60 seconds was exceeded" to Unable to open Special:Undelete form on dewiki due to execution timeout.Mar 31 2021, 11:51 PM
Krinkle added subscribers: BPirkle, tstarling, Krinkle.

Still seen, and even for the same dewiki page (Spezial:Wiederherstellen/Wikipedia). This suggests the community might really like part of that page history back and they're unable to even open the form, it seems?

  • reqId: YEIlhidc9OQ0I0wRI76CnQAAAM4

This task is currently not on any team's radar, though. I'm tagging PE to start with since they're most familiar with the page deletion functonality and have refactored this in the past year (@tstarling, @BPirkle). If you need input from someone more familiar with HTMLForm and OOUI (if that's used here), could ping Volker from Reading-Web.

I'm was looking to related tickets and current one and saw that there was mentioned solution to create an instance to limited amount of result (example: maximum 1000 latest revision to show in Special: Undelete page history). It looks like a hot fix for this issue.
I have several ideas that can be more complicated, but probably will be more user friendly:

  • We could add a button (example: Load more) to the bottom of the page, so user can get revisions by batches (example: 50 revision in one batch).
  • Also that will be great to have filter by date there, so If we have old page that was deleted and has a lot of revisions, user will have a possibility quickly found revisions that he want to restored.

@tstarling Could you please provide a feedback about it?

I think a "load more" button is the minimal fix. Maybe use a generous batch size of 250 rather than 50, since it's an admin UI and that will more often preserve the current experience.

If you add paging or filters, my concern is that you might also need to change the form submit UI to assemble data from invisible checkboxes. If the user changes the filter, you ideally want to save selected checkboxes. So that makes it a larger fix.

A "load more" button is fairly rare in MediaWiki, but have a look at how live recent changes update works. If you go to https://en.wikipedia.org/wiki/Special:RecentChanges and click "live updates", a script on the page periodically loads more rows, by sending a request with action=render&peek=1. The use of action=render is a pretty standard way to turn off the skin -- it's implemented in ChangesListSpecialPage.php line 637 by calling OutputPage::setArticleBodyOnly(). peek=1 modifies the way empty result sets are delivered. I think Special:Undelete could do something similar in a "load more" button.

It's a simple way to do it because you don't need row formatting functions in JavaScript, all the formatting stays in PHP. If it used the API to fetch JSON and format it, that would be a bigger project.

Probably nobody is going to click "load more" 1000 times on Wikipedia:Spielwiese. That's OK, the main point is to make the form be visible without throwing an exception. If they want to selectively undelete some specific revision from the middle of a list of 261k revisions, they can ask for that in a separate task.

@tstarling As I understand well, "live updates" it's just a trigger to call action that get latest 50/100/250/500 row from database for Special:RecentChanges page. So probably it not loads more rows, it's just get latest rows (with limit count). Or maybe I miss something in implementation. What I think about, that create some variable like "historyLimit" that has default value 250 and every "load more" action will update that value to +250 and get rows from database with new limit, but probably this flow didn't fit our requirements for this fix. I will continue investigate implementation of Special:RecentChanges.

As I understand well, "live updates" it's just a trigger to call action that get latest 50/100/250/500 row from database for Special:RecentChanges page. So probably it not loads more rows, it's just get latest rows (with limit count).

Yes, there are several differences between Special:RecentChanges and Special:Undelete.

What I think about, that create some variable like "historyLimit" that has default value 250 and every "load more" action will update that value to +250 and get rows from database with new limit, but probably this flow didn't fit our requirements for this fix. I will continue investigate implementation of Special:RecentChanges.

On the initial query, use a limit of 251 but only display 250. When "load more" is clicked, use the timestamp of the last invisible row to fetch the next page of results, using an index condition`ar_timestamp<=$timestamp`. When the number of results returned by the query is less than 251, you know that you are at the end of the results and you don't need to display a "load more" button.

AnnaMikla added a subscriber: roman-stolar.

Hi @tstarling ! Short update for this task. I have made button with ajax call (js file connected like module) that sends timestamp to backend, getting correct data from DB and backend logic for this. There was one case left: 1) Render new data without page reload using “action=render” and “peek” parameters. And it looks like we will need some js code for that.

Change 702127 had a related patch set uploaded (by Zabe; author: arttsymbar):

[mediawiki/core@master] Special:Undelete page - adding \"load more\" button

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

Hi @tstarling ! I have finished task and have succeeded tests. Could you make a code review, please?

Change 702127 had a related patch set uploaded (by Ostap Smolar; author: arttsymbar):

[mediawiki/core@master] Add \"load more\" button to get Special:Undelete revisions by parts.

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

Zabe changed Request URL from https://de.wikipedia.org//wiki/Spezial:Wiederherstellen/Wikipedia:Spielwiese to https://de.wikipedia.org/wiki/Spezial:Wiederherstellen/Wikipedia:Spielwiese.Dec 28 2021, 7:19 PM

Hi! I have merged master into patch and solved merge conflicts. Please review.

Change 921884 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/core@master] Special:Undelete "load more" followups

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

Change 702127 merged by jenkins-bot:

[mediawiki/core@master] Add load more button to get Special:Undelete revisions by parts.

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

Change 921884 merged by jenkins-bot:

[mediawiki/core@master] Special:Undelete "load more" followups

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

Change 924061 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/core@master] SpecialUndelete: Phase out 'mediawiki.special.undelete' module (again)

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

Change 924061 merged by jenkins-bot:

[mediawiki/core@master] SpecialUndelete: Phase out 'mediawiki.special.undelete' module (again)

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

matmarex subscribed.

I suppose this is resolved by the patches.