This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: advise *strongly* against uncaughtException
- Loading branch information
1 parent
e1fb7b7
commit e8af340
Showing
1 changed file
with
12 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e8af340
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.
So if uncaughtException may be removed in the future, does that mean every node.js process will have at least 1 domain?
If so, I was under the impression domains had some kind of performance penalty? If not, it seems like dropping uncaughtException gives us no control over what happens when something blows up (by default)?
e8af340
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.
Perhaps - details are TBD. uncaughtException is beyond redemption though, it's fundamentally broken.
You say that as if it's a bad thing. :-)
e8af340
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.
@bnoordhuis I think that one of alternatives is to introduce globalDomain like
This can be easily implemented as
How do you like it?
e8af340
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.
Since domains is still an experimental feature, I'd prefer not to force it on people just yet. We're still working out bugs and odd edge cases, and might change its behavior significantly in 0.9, depending on what we learn from people using it over the next few months.
e8af340
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.
@shigeki Looks like a reasonable approach to me.
[EDIT: hadn't noticed that @isaacs already commented.]
e8af340
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.
@isaacs The change of document in this commit indicates to use
domain
instead ofuncaughtException
event. I think we should provide alternative solutions to make the most use ofdomain
.e8af340
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.
uncaughtException is useful for doing things to log exception, otherwise you don't know why something died