-
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
src,http: fix uncaughtException miss in http #5591
Conversation
1285e18
to
9653cde
Compare
b7025ca
to
e6eac8a
Compare
/cc @nodejs/ctc @nodejs/collaborators if anyone feels up for it please do a code review! |
e6eac8a
to
06ec4ea
Compare
@@ -1198,7 +1198,10 @@ Local<Value> MakeCallback(Environment* env, | |||
} | |||
|
|||
if (ret.IsEmpty()) { | |||
return Undefined(env->isolate()); | |||
if (callback_scope.in_makecallback()) |
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.
Would it be useful to add a comment here mentioning that undefined
is returned here for backward compatibility?
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.
Can do.
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.
done, just below.
@trevnorris Do we want to handle both cases (being in a recursive |
@misterdjules TBH I'm more concerned about making sure everything is backward compatible w/ v4. After async wrap is backported and public i'll go through and make those APIs return |
06ec4ea
to
b856c13
Compare
Sounds good! Another case I missed to mention is https://github.com/nodejs/node/blob/master/src/async-wrap.cc#L196. I don't have the time to create a repro for that use case, but I'd imagine it would be possible to write one that exposes a problem where a callback executed by What do you think? |
@misterdjules |
b856c13
to
d5c1024
Compare
Everything's fixed up. Just need the sign-off. |
@trevnorris LGTM. Thank you! |
In AsyncWrap::MakeCallback always return empty handle if there is an error. In the future this should change to return a v8::MaybeLocal, but that major change will have to wait for v6.x, and these changes are meant to be backported to v4.x. The HTTParser call to AsyncWrap::MakeCallback failed because it expected a thrown call to return an empty handle. In node::MakeCallback return an empty handle if the call is in_makecallback(), otherwise return v8::Undefined() as usual to preserve backwards compatibility. Fixes: nodejs#5555 PR-URL: nodejs#5591 Reviewed-By: Julien Gilli <[email protected]>
d5c1024
to
3521b05
Compare
Thanks much! Landed in 3521b05. |
In AsyncWrap::MakeCallback always return empty handle if there is an error. In the future this should change to return a v8::MaybeLocal, but that major change will have to wait for v6.x, and these changes are meant to be backported to v4.x. The HTTParser call to AsyncWrap::MakeCallback failed because it expected a thrown call to return an empty handle. In node::MakeCallback return an empty handle if the call is in_makecallback(), otherwise return v8::Undefined() as usual to preserve backwards compatibility. Fixes: #5555 PR-URL: #5591 Reviewed-By: Julien Gilli <[email protected]>
In AsyncWrap::MakeCallback always return empty handle if there is an error. In the future this should change to return a v8::MaybeLocal, but that major change will have to wait for v6.x, and these changes are meant to be backported to v4.x. The HTTParser call to AsyncWrap::MakeCallback failed because it expected a thrown call to return an empty handle. In node::MakeCallback return an empty handle if the call is in_makecallback(), otherwise return v8::Undefined() as usual to preserve backwards compatibility. Fixes: #5555 PR-URL: #5591 Reviewed-By: Julien Gilli <[email protected]>
Notable changes: * child_process: “send()” now accepts an options parameter (cjihrig) #5283 - Currently the only option is “keepOpen”, which keeps the underlying socket open after the message is sent. * constants: “ENGINE_METHOD_RSA” is now correctly exposed (Sam Roberts) #5463 * Fixed two regressions which originated in v5.7.0: - http: Errors inside of http client callbacks now propagate correctly (Trevor Norris) #5591 - path: Fixed normalization of absolute paths (Evan Lucas) #5589 * repl: “start()” no longer requires an options parameter (cjihrig) #5388 * util: Improved “format()” performance 50-300% (Evan Lucas) #5360 PR-URL: #5559
Notable changes: * child_process: “send()” now accepts an options parameter (cjihrig) nodejs#5283 - Currently the only option is “keepOpen”, which keeps the underlying socket open after the message is sent. * constants: “ENGINE_METHOD_RSA” is now correctly exposed (Sam Roberts) nodejs#5463 * Fixed two regressions which originated in v5.7.0: - http: Errors inside of http client callbacks now propagate correctly (Trevor Norris) nodejs#5591 - path: Fixed normalization of absolute paths (Evan Lucas) nodejs#5589 * repl: “start()” no longer requires an options parameter (cjihrig) nodejs#5388 * util: Improved “format()” performance 50-300% (Evan Lucas) nodejs#5360 PR-URL: nodejs#5559
adding don't land as we are not backporting the other change. edit: the other change is under lts-watch, and now so is this |
In AsyncWrap::MakeCallback always return empty handle if there is an error. In the future this should change to return a v8::MaybeLocal, but that major change will have to wait for v6.x, and these changes are meant to be backported to v4.x. The HTTParser call to AsyncWrap::MakeCallback failed because it expected a thrown call to return an empty handle. In node::MakeCallback return an empty handle if the call is in_makecallback(), otherwise return v8::Undefined() as usual to preserve backwards compatibility. Ref: #7048 Fixes: #5555 PR-URL: #5591 Reviewed-By: Julien Gilli <[email protected]>
In AsyncWrap::MakeCallback always return empty handle if there is an error. In the future this should change to return a v8::MaybeLocal, but that major change will have to wait for v6.x, and these changes are meant to be backported to v4.x. The HTTParser call to AsyncWrap::MakeCallback failed because it expected a thrown call to return an empty handle. In node::MakeCallback return an empty handle if the call is in_makecallback(), otherwise return v8::Undefined() as usual to preserve backwards compatibility. Ref: #7048 Fixes: #5555 PR-URL: #5591 Reviewed-By: Julien Gilli <[email protected]>
In AsyncWrap::MakeCallback always return empty handle if there is an error. In the future this should change to return a v8::MaybeLocal, but that major change will have to wait for v6.x, and these changes are meant to be backported to v4.x. The HTTParser call to AsyncWrap::MakeCallback failed because it expected a thrown call to return an empty handle. In node::MakeCallback return an empty handle if the call is in_makecallback(), otherwise return v8::Undefined() as usual to preserve backwards compatibility. Ref: #7048 Fixes: #5555 PR-URL: #5591 Reviewed-By: Julien Gilli <[email protected]>
In AsyncWrap::MakeCallback always return empty handle if there is an error. In the future this should change to return a v8::MaybeLocal, but that major change will have to wait for v6.x, and these changes are meant to be backported to v4.x. The HTTParser call to AsyncWrap::MakeCallback failed because it expected a thrown call to return an empty handle. In node::MakeCallback return an empty handle if the call is in_makecallback(), otherwise return v8::Undefined() as usual to preserve backwards compatibility. Ref: #7048 Fixes: #5555 PR-URL: #5591 Reviewed-By: Julien Gilli <[email protected]>
In AsyncWrap::MakeCallback always return empty handle if there is an
error. In the future this should change to return a v8::MaybeLocal, but
that major change will have to wait for v6.x, and these changes are
meant to be backported to v4.x.
The HTTParser call to AsyncWrap::MakeCallback failed because it expected
a thrown call to return an empty handle.
In node::MakeCallback return an empty handle if the call is
in_makecallback(), otherwise return v8::Undefined() as usual to preserve
backwards compatibility.
Follow up from #5571 where was decided patch would land on master first.
R=@misterdjules
R=@indutny
R=@thealphanerd
CI: https://ci.nodejs.org/job/node-test-pull-request/1876/