Page MenuHomePhabricator

Incompatible with Node 0.10
Closed, ResolvedPublic

Description

As documented at http://blog.nodejs.org/2013/03/11/node-v0-10-0-stable/ and http://blog.nodejs.org/2012/12/20/streams2/ the new stable version of node changes the streams API. As noted there, "Old programs will almost always work without modification, but streams start out in a paused state, and need to be read from to be consumed. WARNING: If you never add a 'data' event handler, or call resume(), then it'll sit in a paused state forever and never emit 'end'."

That matches the behavior I saw when I tested parsoid with a node 0.9 prerelease -- node api/server.js appeared to "hang" without ever doing anything. I didn't do any digging to find out which part was failing; it could well be one of our npm dependencies which needs to be updated.

As discussed in bug 45993, it appears that a monkey-patch we're doing to domino also stops working in node 0.10. I'm hoping we get an new upstream release of domino to fix that.

There may be other issues with node 0.10...


Version: unspecified
Severity: normal

Details

Reference
bz45994

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:36 AM
bzimport added a project: Parsoid.
bzimport set Reference to bz45994.

See https://github.com/aredridel/html5/issues/73 -- the html5 package also has issues with node 0.10, so bug 47323 is probably a blocker for this bug.

Related URL: https://gerrit.wikimedia.org/r/60681 (Gerrit Change Ifd7800f1d2949c4e0b0ce186755e26dc65b2d506)

With the above patch, api/server.js fails with:

TypeError: Cannot assign to read only property '' of #<Object>

at new Namespace (/home/cananian/Projects/Mediawiki/Parsoid/js/lib/mediawiki.Title.js:116:40)
at new Title (/home/cananian/Projects/Mediawiki/Parsoid/js/lib/mediawiki.Title.js:19:12)
at Function.Title.fromPrefixedText (/home/cananian/Projects/Mediawiki/Parsoid/js/lib/mediawiki.Title.js:49:10)
at WikiLinkHandler.onWikiLink (/home/cananian/Projects/Mediawiki/Parsoid/js/lib/ext.core.LinkHandler.js:127:17)
at AsyncTokenTransformManager.transformTokens (/home/cananian/Projects/Mediawiki/Parsoid/js/lib/mediawiki.TokenTransformManager.js:596:17)
at AsyncTokenTransformManager.onChunk (/home/cananian/Projects/Mediawiki/Parsoid/js/lib/mediawiki.TokenTransformManager.js:381:17)
at SyncTokenTransformManager.EventEmitter.emit (events.js:117:20)
at SyncTokenTransformManager.onChunk (/home/cananian/Projects/Mediawiki/Parsoid/js/lib/mediawiki.TokenTransformManager.js:945:7)
at PegTokenizer.EventEmitter.emit (events.js:95:17)
at emitChunk (eval at <anonymous> (/home/cananian/Projects/Mediawiki/Parsoid/js/lib/mediawiki.tokenizer.peg.js:93:44), <anonymous>:17080:23)

and tests/parserTests.js hangs. So there's still work to do here.

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

We're hoping that we don't need to update html5 (yet). The domino fix mentioned above has already been fixed. The html5 package issues linked from comment 1 looked like they were related to the use of process.nextTick() inside html5's test runner (tap) instead of in html5 proper. (knock on wood)

The html5 issue report des suggest running node with --throw-deprecation though.

And we do have a number of calls to process.nextTick() in parsoid (in ext.core.ParserFunctions, ext.core.QuoteTransformer.js, mediawiki.ApiRequest.js, mediawiki.tokenizer.peg.js, and tests/parserTests.js).

Worst-case we might need to add a Util.nextTick() to call process.nextTick or setImmediate(), depending on the node version. Hopefully that won't be necessary, since I don't think we're doing anything too clever with process.nextTick.

For more details on the nextTick issue, see http://stackoverflow.com/questions/15349733/setimmediate-vs-nexttick and
http://nodejs.org/docs/latest/api/process.html#process_process_maxtickdepth

Change 76114 had a related patch set uploaded by Arlolra:
Node v0.10.x Compatibility

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

Change 76114 merged by jenkins-bot:
Node v0.10.x Compatibility

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