Last modified: 2012-11-29 16:51:34 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 T44071, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 42071 - Large numbers of instances on a page cause browsers to hang or crash
Large numbers of instances on a page cause browsers to hang or crash
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
TimedMediaHandler (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Michael Dale
:
: 42541 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-13 17:33 UTC by Brad Jorsch
Modified: 2012-11-29 16:51 UTC (History)
3 users (show)

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


Attachments

Description Brad Jorsch 2012-11-13 17:33:36 UTC
On enwiki, the page [[en:Portal:Featured sounds]] embeds 380 media files. Something within TimedMediaHandler causes my browser on my laptop (Firefox 16.0.2, Linux) to grind (100% CPU, unresponsive) for about 10 minutes at around the time the DOMReady or onLoad event fires, apparently while generating the UI for all those embeds. Others on IRC reported similar experiences or outright crashes in Firefox and Chrome. In further testing, a page with 90 embeds seemed to be handled fine for me, and a page with 180 ground for about 15 seconds.

If this can't be fixed directly, perhaps TMH can process the embeds on the page in batches (waiting for one batch to complete before the next runs) or just refuse to process over a certain number of embeds in a page.
Comment 1 Michael Dale 2012-11-13 19:09:02 UTC
Some profiling indicates the loading animation for so many simultaneous rewriting is causing issues. 

I have set the the players to rewrite one at a time
https://gerrit.wikimedia.org/r/33210

Tested on a page with 600 players, no crash or lockup, but takes some time to rewrite all the players.

Further down the road we should better handle this with something like thumbembed ( for audio players ) Where we can embed hundreds of players at a cost of < 1ms or so each ( we also use this on the gallery pages for videos ) 
http://html5video.org/kaltura-player/docs/Embeding/thumb
Comment 2 Brad Jorsch 2012-11-13 21:19:10 UTC
Patch doesn't seem to make a whole lot of difference here; it takes somewhat less time, but still grinds for a long time.

Also, I note that the new "checkSetDone" function is called 16290 times on my test page with 180 embeds. Something is not right there; I wonder if it's somehow processing the first one or two individually, then the multiple callbacks hit and it gets the thundering herd again.
Comment 3 Michael Dale 2012-11-14 04:26:56 UTC
could you try it again ( patch set 2 ) ? It does appear as if there was some call stacking because of jquery event scope issues.
Comment 4 Brad Jorsch 2012-11-14 05:00:33 UTC
There we go, now it works right!

BTW, this was discussed in the MediaWiki Core Team meeting today, and it appears that it only affects audio files and not video for some reason. That may go along with the thumbembed thing you mentioned in comment 1.
Comment 5 Michael Dale 2012-11-20 16:56:08 UTC
We should get this deployed, we are getting duplicate reports i.e: 24988
Comment 6 Jan Gerber 2012-11-20 20:34:33 UTC
https://gerrit.wikimedia.org/r/#/c/33210/ is not merged yet,
can you look the comments?
Comment 7 Michael Dale 2012-11-20 20:58:45 UTC
fixed per inline mw.config.get usage comment https://gerrit.wikimedia.org/r/#/c/33210/2/MwEmbedModules/EmbedPlayer/EmbedPlayer.loader.js
Comment 8 Brad Jorsch 2012-11-29 16:51:34 UTC
*** Bug 42541 has been marked as a duplicate of this bug. ***

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


Navigation
Links