Uh oh!
There was an error while loading. Please reload this page.
stream: emit .write() end error in next tick - #4749
Conversation
There was a problem hiding this comment.
It would probably be better to just call process.nextTick once here and both emit the error and call the callback.
There was a problem hiding this comment.
It would probably be better to just call process.nextTick once here and both emit the error and call the callback.
Sure thing, agreed it looked strange. Just pushed an update.
jasnell
commented
Jan 19, 2016
Generally LGTM once @evanlucas, @mscdex and CI are happy :-) |
evanlucas
commented
Jan 19, 2016
Marking as semver-major as it is a behavior change |
Fishrock123
commented
Jan 19, 2016
@nodejs/streams |
b732435 to
227c9f5Compare227c9f5 to
76f6165CompareThere was a problem hiding this comment.
i'm not sure we transform arrow functions yet in the readable-stream builds. @calvinmetcalf probably knows more about this?
There was a problem hiding this comment.
i'm not sure we transform arrow functions yet in the readable-stream builds.
I'll happily change it to an ordinary function. Really curious about what kind of transformation you're talking about though?
There was a problem hiding this comment.
the readable-stream module is build from the node source using a couple of build methods, https://github.com/nodejs/readable-stream/tree/master/build to get better browser support.
There was a problem hiding this comment.
we do not support arrow functions at the moment, and it would be tricky to do so in a performant manner, that being said, you could change this code to be,
functionwriteAfterEnd(stream,cb){consterr=newError('write after end');stream.emit('error',err);cb(err);}and then replace the use of writeAfterEndErr(this, cb) with
process.nextTick(writeAfterEnd,this,cb);and this would avoid creating an unnecessary closure
There was a problem hiding this comment.
the readable-stream module is build from the node source using a couple of build methods, https://github.com/nodejs/readable-stream/tree/master/build to get better browser support.
Neat, that's some nice wizardry.
and then replace the use of writeAfterEndErr(this, cb) with
Thanks @calvinmetcalf, just pushed an update 👍
chrisdickinson
commented
Jan 19, 2016
I worry about this a little, in that streams can be enormously fussy when it comes to when things happen. A CITGM run with this would ease my mind a bit (especially if CITGM contains stream-using packages, like |
MylesBorins
commented
Jan 19, 2016
@chrisdickinson can you make a short list of stream based packages you would like to see added to citgm? I'd be more than happy to add them then run the smoke-testing suite |
MylesBorins
commented
Jan 19, 2016
current lookup for reference --> https://github.com/nodejs/citgm/blob/master/lib/lookup.json |
This changes the behaviour of error event emitted when writing to a stream after it has ended, from synchronously to asynchronously. PR-URL: nodejs#4749
76f6165 to
1899689Comparephillipj
commented
Jan 21, 2016
I just created these citgm reports @chrisdickinson: This PRFlaky Modules
v4.2.5Flaky Modules
v5.5.0Flaky Modules
P.S. react fails deliberately as it requires v4.x obviously. |
jasnell
commented
Jan 23, 2016
Unfortunately I think failures on those in citgm are common. @thealphanerd can say for sure tho |
MylesBorins
commented
Jan 23, 2016
Those are all expected 😄 |
MylesBorins
commented
Jan 23, 2016
fwiw I think @chrisdickinson wanted to add more modules to citgm that were focused on streams. |
chrisdickinson
commented
Jan 23, 2016
I might see if @phated can recommend some modules from the Gulp ecosystem. |
phated
commented
Jan 25, 2016
@chrisdickinson what are you looking for? |
jasnell
commented
Jan 27, 2016
@phated ... we'd like to get a handful of stream-related modules to add to our smoke-testing infrastructure (http://github.com/nodejs/citgm). We run the tests for every new release and to get an idea of whether a particular change will break the ecosystem. |
phated
commented
Jan 31, 2016
vinyl, vinyl-fs, probably something like gulp-jade or other popular plugins (I don't have actual numbers on any of that) The most important one is probably vinyl-fs which will be receiving even more tests coming up very soon. |
jasnell
commented
Feb 1, 2016
@phated... excellent. /cc @thealphanerd |
MylesBorins
commented
Feb 2, 2016
I've opened a PR adding vinyl, vinyl-fs, and readable-stream to citgm. I'm open to other suggestions |
phillipj
commented
Feb 21, 2016
Updated results after mentioned updates to citgm ^^ Flaky Modules
Identical results ran on master and this branch/PR, in other words doesn't seem like this PR introduces more failures.. @thealphanerd is the spdy failure expected? |
jasnell
commented
Mar 2, 2016
FWIW, still LGTM /cc @nodejs/ctc |
jasnell
commented
Mar 2, 2016
Actually.. looks like this change is also applied in #5251 ... may be able to close this in favor of that one |
phillipj
commented
Mar 2, 2016
Yep, surely looks like we've done some duplicate work on this one. As #5251 fixes alot more of these issues, I'll close this one and re-open if the other one doesn't land. |
Next up in my TODO triaging, this time in _stream_writable.js.
Assuming it should be labelled semver-major as it changes from emitting error synchronously to async.