-
Notifications
You must be signed in to change notification settings - Fork 645
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
Better Ctrl-C Behavior #140
Conversation
After running |
@@ -26,3 +26,32 @@ daemon.on('error', function(err) { | |||
daemon.on('open', function(status) { | |||
log.info('status="%s"', status); | |||
}); | |||
|
|||
function exitHandler(options, err) { |
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 this is reused. Should it be a part of the Node?
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.
It makes sense to have this in the bin scripts and not lib/ because other people using bitcore node in their own application may want to handle process signals differently. I'm up for having a util class in bin/ which can have the exit handler if we don't want to have the same code twice, or we can wait for your command line interface changes and deal with it then.
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.
Or we can put it as Node.prototype.defaultExitHandler.
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.
We can handle this in another PR.
With the changes in pnagurny#1 I'm getting a segment fault after shutdown. I've tracked it down to an issue with closing LevelDB in leveldown, and is likely related to Level/leveldown#157 |
- when using bitcoin as a shared lib, there should not be any need for bitcoind to be handling its own signals.
677fe49
to
025a5d2
Compare
025a5d2
to
faf93a1
Compare
LGTM |
Excellent work on this, the shutdown behavior is much better now. |
No description provided.