-
Notifications
You must be signed in to change notification settings - Fork 7.3k
domains: port fix abort on uncaught to v0.12 #25835
Conversation
Thank you @whitlockjc! Tests running on UNIX and on Windows. |
@orangemocha I've re-enabled the node-accept-pull-request job on jenkins.nodejs.org to test this PR because when I tried to use the node-test-pull-request job on jenkins-iojs.nodesource.com, it failed: https://jenkins-iojs.nodesource.com/job/node-test-pull-request/63/. |
/cc @joyent/node-collaborators |
@whitlockjc Fixing them should be straightforward, could you please update this PR with a fix when you have some time? Thank you! |
You got it. I'm sure their failures are similar to the fix for OS X where we have to check for different exit codes. I'll update the PR. |
The issue should be fixed: https://jenkins-iojs.nodesource.com/job/node-test-pull-request/65/ In any case, you can use node-accept-pull-request from the new Jenkins. I have re-disabled the old one now. Let me know if you still have problems. Thanks! |
A fix for similar issue(s) was merged in io.js a while ago: nodejs/node#922. That fix has the advantage of not requiring to make any change to V8, so it would be great if we could use it instead of the changes in this PR. However, it seems that that fix does not fix #8630:
It seems to also make a node process not abort when it seems it should:
In the test above, I would expect node to abort, not the @chrisdickinson Thoughts? |
5d695f9
to
302433a
Compare
I have updated the tests to pass on Linux and SmartOS. This involved always checking the exit signal, even though SmartOS is the only one right now that gets a signal other than |
Thank you @whitlockjc! Reran the whole tests suite here: https://jenkins-iojs.nodesource.com/job/node-accept-pull-request/. We have one failure on Windows. This is also related to changes in the implementation of |
I'll get on it. |
302433a
to
2c84036
Compare
Fixed, @misterdjules was right...this was a result of |
@whitlockjc Thank you! All tests passed. |
WOOHOO!!! |
@misterdjules ... is this ready to land? |
I don't want this to drop through the cracks so can we update this with the next steps? Really hoping to either find out that this isn't necessary in the new node repository or be told what the next steps are. If it's still useful/important, I'll gladly port this to the new repository via a PR. /cc @nodejs/collaborators and @nodejs/tsc |
@whitlockjc I've ported this PR in nodejs/node's master with nodejs/node#3036 because of nodejs/node#3035. The next step for this PR is for me to give it a final review and land it in v0.12. |
Thanks a lot. I was planning on porting this today but since you beat me to it... ;) |
if (fatal_exception_depth == 0 && | ||
FLAG_abort_on_uncaught_exception && | ||
(FLAG_abort_on_uncaught_exception) && |
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 should be no parentheses around FLAG_abort_on_uncaught_exception
.
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.
Yup, that was an oversight...probably a relic from previous debugging session.
@whitlockjc Added more comments. Also, it would be great to split this PR in two different commits, the first one for the changes in deps/v8, and the second one for the changes outside of deps/v8. This way we can isolate and document this new floating patch in https://github.com/nodejs/node-v0.x-archive/wiki/V8-upgrade-process#v012x. When these are addressed we can land this PR in v0.12. Thank you for your work again! 👍 |
You got it. I'll get on it. |
2c84036
to
7847402
Compare
I've addressed the changes @misterdjules suggested. I will not break the singular port commit into two port commits. When this is complete, I will update you. |
fbff705 Add v8::Isolate::SetAbortOnUncaughtException() so the user can be notified when an uncaught exception has bubbled.
caeb677 Do not abort the process if an error is thrown from within a domain, an error handler is setup for the domain and --abort-on-uncaught-exception was passed on the command line. However, if an error is thrown from within the top-level domain's error handler and --abort-on-uncaught-exception was passed on the command line, make the process abort. Fixes: nodejs#8877
7847402
to
23b3c10
Compare
I have broken the PR commit into two commits, one for |
LGTM. Thank you once again @whitlockjc! |
Landing with https://ci.nodejs.org/job/node-accept-pull-request/129/. |
fbff705 Add v8::Isolate::SetAbortOnUncaughtException() so the user can be notified when an uncaught exception has bubbled. Fixes: nodejs/node-v0.x-archive#8877 PR-URL: nodejs/node-v0.x-archive#25835 Reviewed-By: misterdjules - Julien Gilli <jgilli@nodejs.org>
caeb677 Do not abort the process if an error is thrown from within a domain, an error handler is setup for the domain and --abort-on-uncaught-exception was passed on the command line. However, if an error is thrown from within the top-level domain's error handler and --abort-on-uncaught-exception was passed on the command line, make the process abort. Fixes: #8877 Fixes: nodejs/node-v0.x-archive#8877 PR-URL: nodejs/node-v0.x-archive#25835 Reviewed-By: misterdjules - Julien Gilli <jgilli@nodejs.org>
Is there a next step for getting this into nodejs/node? |
@whitlockjc These two commits are in nodejs/node's v0.12 branch. I'll follow-up on nodejs/node#3036 when I get some feedback about the V8 changes in https://codereview.chromium.org/1375933003/. If that takes too long, or if it turns out nodejs/node#3036 is not the solution we want to consider, we'll consider the other options mentioned in nodejs/node#3035. |
Gotcha. Thanks for the heads up and let me know if I can help further regardless of the decisions mentioned above. |
Revert 0af4c9e, parts of 921f2de and port nodejs/node-v0.x-archive#25835 from v0.12 to master so that node aborts at the right time when an error is thrown and --abort-on-uncaught-exception is used. Fixes nodejs#3035.
fbff705 Add v8::Isolate::SetAbortOnUncaughtException() so the user can be notified when an uncaught exception has bubbled. Fixes: nodejs#8877 PR-URL: nodejs#25835 Reviewed-By: misterdjules - Julien Gilli <jgilli@nodejs.org>
caeb677 Do not abort the process if an error is thrown from within a domain, an error handler is setup for the domain and --abort-on-uncaught-exception was passed on the command line. However, if an error is thrown from within the top-level domain's error handler and --abort-on-uncaught-exception was passed on the command line, make the process abort. Fixes: nodejs#8877 Fixes: nodejs#8877 PR-URL: nodejs#25835 Reviewed-By: misterdjules - Julien Gilli <jgilli@nodejs.org>
this was cherry-picked manually fbff705 Add v8::Isolate::SetAbortOnUncaughtException() so the user can be notified when an uncaught exception has bubbled. Fixes: nodejs/node-v0.x-archive#8877 PR-URL: nodejs/node-v0.x-archive#25835 Reviewed-By: misterdjules - Julien Gilli <jgilli@nodejs.org>
caeb677 Do not abort the process if an error is thrown from within a domain, an error handler is setup for the domain and --abort-on-uncaught-exception was passed on the command line. However, if an error is thrown from within the top-level domain's error handler and --abort-on-uncaught-exception was passed on the command line, make the process abort. Fixes: nodejs#8877 Fixes: nodejs#8877 PR-URL: nodejs#25835 Reviewed-By: misterdjules - Julien Gilli <jgilli@nodejs.org> Conflicts: lib/domain.js src/env.h test/simple/test-domain-with-abort-on-uncaught-exception.js
this was cherry-picked manually fbff705 Add v8::Isolate::SetAbortOnUncaughtException() so the user can be notified when an uncaught exception has bubbled. Fixes: nodejs/node-v0.x-archive#8877 PR-URL: nodejs/node-v0.x-archive#25835 Reviewed-By: misterdjules - Julien Gilli <jgilli@nodejs.org>
Port fbff705 and caeb677 from v0.10 to v0.12, original commit messages:
fbff705
Add v8::Isolate::SetAbortOnUncaughtException() so the user can be
notified when an uncaught exception has bubbled.
caeb677
Do not abort the process if an error is thrown from within a domain,
an error handler is setup for the domain and
--abort-on-uncaught-exception was passed on the command line.
However, if an error is thrown from within the top-level domain's
error handler and --abort-on-uncaught-exception was passed on the
command line, make the process abort.
Fixes: #8877