-
Notifications
You must be signed in to change notification settings - Fork 86
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
CTRL-C doesn't work during node startup #2584
Comments
I think the first ^C restores the default interrupt handler, so the second always kills the application https://gitlab.haskell.org/ghc/ghc/-/blob/master/libraries/base/GHC/TopHandler.hs#L114 However windows work differently. I've seen programs in the past that require 2 ^C to stop on linux but are unresponsive on Windows |
Indeed.
I haven't tested this particular instance of it on Windows, so I don't know. |
Indeed It is possible that some resources need to be released in a specific order (which is currently ensured by Another note is that |
This is exactly the reason why we use the |
I noticed that when starting
cardano-node
, a single CTRL-C is not enough to stop the node while the ChainDB is still being opened. Opening the ChainDB can take a while, as block validity could be checked, blocks have to be replayed to bring the ledger snapshots up to date (or even from genesis!), and initial chain selection happens. A second CTRL-C does stop the node.The cause of this is that we're opening the ChainDB using
ResourceRegistry.allocate
: https://github.com/input-output-hk/ouroboros-network/blob/d81d370008727ac9811bbc4fc70ea0cbcde7cd28/ouroboros-consensus/src/Ouroboros/Consensus/Node.hs#L189-L193and
ResourceRegistry.allocate
masks asynchronous exceptions while running the opening action: https://github.com/input-output-hk/ouroboros-network/blob/d81d370008727ac9811bbc4fc70ea0cbcde7cd28/ouroboros-consensus/src/Ouroboros/Consensus/Util/ResourceRegistry.hs#L822-L823The text was updated successfully, but these errors were encountered: