inspector: log exceptions in message handlers#14980
inspector: log exceptions in message handlers#14980eugeneo merged 0 commit intonodejs:masterfrom eugeneo:profiler-aix
Conversation
|
I am not entirely sure what to do with the exceptions here.
Any suggestions on a best approach? |
|
@eugeneo ... would you consider these to be fatal events? If so, then option 5 would likely be best, but it's also the most draconian. If they are not fatal, then a 6th option would be to use process.emitWarning() to emit each message as a separate warning. Users can then decide for themselves how they would prefer to handle them (e.g. use the default output to stderr, redirect those to a file, register a warning handler, switch them off entirely, etc). |
|
@jasnell Thank you for the suggestion. I definitely don't think those events are fatal - so now the code emits warnings. |
test/inspector/test-bindings.js
Outdated
There was a problem hiding this comment.
you can use common.mustCall(3) here to limit the number of warning events triggered.
jasnell
left a comment
There was a problem hiding this comment.
LGTM with green CI and a suggestion.
|
Thank you for the review, I updated the code. CI: https://ci.nodejs.org/job/node-test-pull-request/9829/ |
|
Would it be possible to call the callbacks in a |
|
@TimothyGu I'm bit concerned it might be possible to deadlock inspector callback and never see the |
|
@eugeneo Sounds quite complicated… I'll defer to your judgment then! |
|
Hmm... Getting some failures on 32-bit systems. See: https://ci.nodejs.org/job/node-test-commit-linux/12132/nodes=debian8-x86/console |
|
@jasnell I'm fixing them - there's an unexpected warning firing there. |
|
CI failures were not caused by this CL but I am not confident with this test coverage enough to merge this PR. |
|
I've added in the |
|
Landed as 9bae3ea |
Fixes: nodejs#14965 PR-URL: nodejs#14980 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Fixes: #14965
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
inspector: JS bindings were updated.