Page MenuHomePhabricator

http://parsoid.wmflabs.org/en/Single_Ladies_%28Put_a_Ring_on_It%29 slow and broken rendering of {{listen}} template
Closed, ResolvedPublic

Description

This page currently takes ~100 seconds to render in Parsoid, which might be related to the high number of citations and API request timeouts.

The {{listen}} template also contains a broken div rendered as plain text.


Version: unspecified
Severity: normal

Details

Reference
bz45026

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:29 AM
bzimport set Reference to bz45026.

Just expanding '{{Listen}}' with http://parsoid.wmflabs.org/_wikitext/ shows the broken <div>.

This might be related (or it may just be that my install is broken, you should attempt to reproduce this on a known-good setup):

$ echo "{{Listen}}" | node tests/parse.js
ERROR in Main page:
TypeError: Cannot read property 'constructor' of undefined

at AsyncTokenTransformManager.transformTokens (/home/cananian/Projects/OLPC/Narrative/mediawiki/Parsoid/js/lib/mediawiki.TokenTransformManager.js:478:13)
at AsyncTokenTransformManager.onChunk (/home/cananian/Projects/OLPC/Narrative/mediawiki/Parsoid/js/lib/mediawiki.TokenTransformManager.js:352:17)
at SyncTokenTransformManager.EventEmitter.emit (events.js:96:17)
at SyncTokenTransformManager.onChunk (/home/cananian/Projects/OLPC/Narrative/mediawiki/Parsoid/js/lib/mediawiki.TokenTransformManager.js:857:7)
at SyncTokenTransformManager.process (/home/cananian/Projects/OLPC/Narrative/mediawiki/Parsoid/js/lib/mediawiki.TokenTransformManager.js:757:7)
at ParserPipeline.process (/home/cananian/Projects/OLPC/Narrative/mediawiki/Parsoid/js/lib/mediawiki.parser.js:359:21)
at Frame.expand (/home/cananian/Projects/OLPC/Narrative/mediawiki/Parsoid/js/lib/mediawiki.TokenTransformManager.js:1333:13)
at AttributeTransformManager.process (/home/cananian/Projects/OLPC/Narrative/mediawiki/Parsoid/js/lib/mediawiki.TokenTransformManager.js:936:16)
at AttributeExpander.onToken (/home/cananian/Projects/OLPC/Narrative/mediawiki/Parsoid/js/lib/ext.core.AttributeExpander.js:49:7)
at AsyncTokenTransformManager.transformTokens (/home/cananian/Projects/OLPC/Narrative/mediawiki/Parsoid/js/lib/mediawiki.TokenTransformManager.js:524:17)

Looks like this template parse broke in git SHA 555ec42. Will investigate. Thanks Scott.

The crasher was fixed in 9388314d8ec9 (now merged).

The parse failure is related to this unclosed div-attribute in http://en.wikipedia.org/w/index.php?title=Template:listen/core&action=edit

Note the missing " on the 3rd line. So, Parsoid tokenizer doesn't yet handle this. I guess we can make Parsoid more robust, but maybe also fix the template?

See https://bugzilla.wikimedia.org/show_bug.cgi?id=45341 for another example of fixing a template was considered the right fix.

Submitted an edit request at:

http://en.wikipedia.org/wiki/Template_talk:Listen#Missing_quote_in_template_source

Meanwhile will add a new ticket to be more liberal while parsing.

And looks like it's been fixed.

It also seems to parse reasonably quickly (30-35 secs on my laptop). So, resolving this. Reopen if there is any other related issue.

[Parsoid component reorg by merging JS/General and General. See bug 50685 for more information. Filter bugmail on this comment. parsoidreorg20130704]