-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
Revert "net: remove unnecessary process.nextTick()" #12854
Conversation
Commit description should probably note that there is no behavior change here since |
I wonder if it would be better to instead just use |
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.
This is the second regression from this PR we've seen. We definitely may be able to take another stab at refactoring this, but a simple revert is best, I think, and we can do more later.
A regression test should be added. #2054 could (and arguably should) have done that but better late than never. |
Yep, will get that updated tonight or tomorrow |
Ok, so it looks like 503b089 added a regression test for the original issue, but only tested against net and not an http request. In this case, the http request calls The error listener is added to the socket here which is called in process.nextTick() in |
Ok, so looks like this now breaks an async-hooks test
Going to look more into this for the best solution |
/cc @AndreasMadsen (since it seems to be async-hooks related) any suggestions on the error I'm now getting above with this change? |
I think it should be |
ok, updated to account for async-hooks. PTAL |
I killed the CI by mistake, sorry. |
@cjihrig @jasnell @benjamingr mind taking another quick look. I added a regression test since yall approved it previously. Thanks! CI one more time: https://ci.nodejs.org/job/node-test-pull-request/8226/ |
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. A comment near the top of the test and some validation of the error object might be useful.
This reverts commit 571882c. Removing the process.nextTick() call can prevent the consumer from being able to catch error events. PR-URL: nodejs#12854 Fixes: nodejs#12841 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
This test ensures that a http client request with the default agent that has a socket that is immediately destroyed can still be caught by adding an error event listener to the request object. PR-URL: nodejs#12854 Fixes: nodejs#12841 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
This reverts commit 571882c. Removing the process.nextTick() call can prevent the consumer from being able to catch error events. PR-URL: #12854 Fixes: #12841 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
This test ensures that a http client request with the default agent that has a socket that is immediately destroyed can still be caught by adding an error event listener to the request object. PR-URL: #12854 Fixes: #12841 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
This reverts commit 571882c. Removing the process.nextTick() call can prevent the consumer from being able to catch error events. PR-URL: #12854 Fixes: #12841 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
This test ensures that a http client request with the default agent that has a socket that is immediately destroyed can still be caught by adding an error event listener to the request object. PR-URL: #12854 Fixes: #12841 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
This reverts commit 571882c.
Removing the process.nextTick() call can prevent the consumer
from being able to catch error events.
Looks like we ran into this before in af249fa
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
/cc @bnoordhuis