Last modified: 2013-07-25 11:09:10 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T26375, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 24375 - $wgDeferredUpdateList and long-running scripts
$wgDeferredUpdateList and long-running scripts
Status: NEW
Product: MediaWiki
Classification: Unclassified
Maintenance scripts (Other open bugs)
1.17.x
All All
: Low minor (vote)
: ---
Assigned To: Tyler Romeo
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-07-14 18:40 UTC by Aaron Schulz
Modified: 2013-07-25 11:09 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Aaron Schulz 2010-07-14 18:40:00 UTC
Import scripts and probably other maintenance script call things like doEdit() or (onArticleEdit() directly) which builds up $wgDeferredUpdateList. These updates are not done until it finishes whatever it was doing, which means the $wgDeferredUpdateList array can get huge and slow.

Maybe:
(a) they should call wfDoUpdates() around wfWaitForSlaves(). This is simple but requires script writers to remember non-obvious crap
(b) stuff that uses wgDeferredUpdateList does it immediately if in cli mode
(c) stuff that uses wgDeferredUpdateList does do (nor defer) updates when in cli mode. Callers would have to do whatever themselves (which could lead to duplicated code).
Comment 1 Aaron Schulz 2010-12-11 19:41:35 UTC
Ugh, (c) should be:
"(c) stuff that uses wgDeferredUpdateList does not do (nor defer) updates when in
cli mode. Callers would have to do whatever themselves (which could lead to
duplicated code)."
Comment 2 Tyler Romeo 2013-02-11 03:23:29 UTC
(a) seems like a good solution: https://gerrit.wikimedia.org/r/48412

If anybody thinks (b) or (c) would be preferred then I'll abandon that patch.
Comment 3 Aaron Schulz 2013-02-14 18:16:14 UTC
Well that makes sure they are done, but it doesn't deal with the array bloat problem (which really slows down as the array gets larger).

It might help to use a wrapper function instead of just $wgDeferredUpdateList[]=stuff. Then would could have an option (d) where it starts doing some updates if the list is too big (in cli mode).
Comment 4 Tyler Romeo 2013-02-14 19:02:49 UTC
Agreed, but at the very least that patch is a good first step. I mean, it's only natural that a maintenance script should commit deferred updates upon exiting the script.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links