Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.3k
net/streams: don't return the stream object from onStreamRead#34375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Conversation
lpinca commented Jul 15, 2020
Is it possible to add a regression test? |
robey commented Jul 15, 2020
i think you would need to have some integration tests, sadly. it doesn't seem possible for a connection to be "reset" between two sockets on the same machine. (my understanding is that ECONNRESET is a response to unexpectedly receiving a TCP RST.) another way you could do it is to fake up the ECONNRESET by mucking around in the internals somehow, but i'm not sure how you can trick libuv into doing that. would be cool tho! |
lpinca commented Jul 15, 2020
I think |
ronag left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is another instance of this here https://github.com/nodejs/node/pull/34375/files#diff-704db381d3305bdcd2c6b8b3468acfb7R230
robey commented Jul 18, 2020
good eye! i went ahead and fixed that one too, while i was in here. |
mcollina commented Jul 18, 2020
Can you please add a unit test? |
robey commented Jul 18, 2020
as i said above, if you can think of a way to do it without having a cross-process integration test, i'm happy to try it. |
mcollina commented Jul 18, 2020
would it be possible to use child processes? We have a few tests that use them for similar purposes. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
addaleax left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would probably also update the crash site in stream_base.cc to check for next_buf_v->IsArrayBufferView() instead of !next_buf_v->IsUndefined() (although that can be done as a separate fix)
robey commented Jul 19, 2020
i figured out some sample code that causes the crash (see bug), so i added that as a unit test. :) |
robey commented Jul 19, 2020
sure, added that too. :) |
mcollina left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
addaleax left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still LGTM :)
nodejs-github-bot commented Jul 20, 2020
nodejs-github-bot commented Jul 21, 2020
jasnell commented Jul 23, 2020 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Looks like there are a number of possibly relevant failures in CI |
robey commented Jul 23, 2020
i assumed these were all spurious since "make test" passes cleanly (except the one that always fails). which test is failing for you and how can i repro it? |
lpinca commented Jul 23, 2020
@robey here are a few examples: node-test-commit-freebsd node-test-commit-smartos node-test-commit-windows-fanned |
src/stream_base.cc Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might this be what's causing problems?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense... ok, i reverted that part.
CallJSOnreadMethod expects the return value to be undefined or a new buffer, so make sure to return nothing, even when an error causes us to destroy the stream. Fixes: #34346
robey commented Aug 7, 2020
it doesn't seem like there's any interest in this patch, so i'll close it next week. we can run a fork of node internally. sorry it didn't work out. |
nodejs-github-bot commented Aug 7, 2020
lpinca commented Aug 7, 2020
CI is green. I think this can land. |
addaleax commented Aug 8, 2020
Landed in c0be31f, and sorry for the delay! |
CallJSOnreadMethod expects the return value to be undefined or a new buffer, so make sure to return nothing, even when an error causes us to destroy the stream. Fixes: #34346 PR-URL: #34375 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
CallJSOnreadMethod expects the return value to be undefined or a new buffer, so make sure to return nothing, even when an error causes us to destroy the stream. Fixes: #34346 PR-URL: #34375 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
CallJSOnreadMethod expects the return value to be undefined or a new buffer, so make sure to return nothing, even when an error causes us to destroy the stream. Fixes: #34346 PR-URL: #34375 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
CallJSOnreadMethod expects the return value to be undefined or a new buffer, so make sure to return nothing, even when an error causes us to destroy the stream. Fixes: #34346 PR-URL: #34375 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
CallJSOnreadMethod expects the return value to be undefined or a new buffer, so make sure to return nothing, even when an error causes us to destroy the stream. Fixes: #34346 PR-URL: #34375 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
CallJSOnreadMethod expects the return value to be undefined or
a new buffer, so make sure to return nothing, even when an error
causes us to destroy the stream.
Fixes: #34346
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes