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
cardano-node expects SIGINT not SIGTERM for graceful shutdown #2627
Comments
It's possible something like
may work |
It would be nice if Even better This makes it almost impossible to use the upstream docker image as a base for another:
|
Something like this worked for me to create something hookable:
|
This is a duplicate of #2353 which would be fixed by PR #2608. In the meantime, you can use the nessusio/cardano-node image which is a multiarch clone of the IOHK image that among other things also fixes this issue. |
Curious why cardano-node doesn't just natively trap SIGTERM? There seems to be an excessive amount of bash support junk that could just be added directly to cardano-node, including all of the environment handling and command line varietals. |
This might be a question best answered by cardano-node itself. As it stands now, substantial improvements to the cardano-node image are available and have been for months. From my part the proposal can be adopted, partially adopted, rejected for a better proposal, etc. It is also not a conclusive proposal that claims to set things in stone. Instead it proposes a number of small iterative steps to the cardano-node image, which over time can be modified and expanded on by folks who like to contribute to the cardano project with their domain knowledge. Perhaps they are not adopting because of legal issues (i.e. a suitable contributor agreement), who knows? |
I solved this issue with "STOPSIGNAL SIGINT" statement in Dockerfile |
This should be out of date |
In which version is it released? I have a workaround for it in our CI and need to know on which versions it is no longer needed. |
This is the same workaround I am using. |
It'll be in 1.28.0 |
Is the solution with "STOPSIGNAL SIGINT" in the dockerfile still valid for version 1.34.1? I used it but my container is not stopping gracefully. My dockerfile is this one: https://github.com/jterrier84/Cardano-node-docker/blob/master/dockerfiles/armada-cn-arm64.dockerfile. Would appreciate your help. |
Closing this. If this is still relevant please reopen. |
docker stop
does not politely shut down the cardano-node container built by:https://github.com/input-output-hk/cardano-node/blob/9088aacfae5c46a8b4bd4ed056f8e37d7cf42811/nix/docker.nix#L100
This is because cardano-node expects SIGINT, not SIGTERM (the docker default).
In a Dockerfile, this can be overridden by
STOPSIGNAL
, but nix-docker doesn't seem to be aware that is an option.docker kill -s INT
isn't useful, since it doesn't fall back on KILL if it fails, and it also exits immediately, which means you need to do adocker wait
... which is useless because docker, in their infinite wisdom, don't have a timeout option for wait.Then again, you'd think they'd add a
--signal
option fordocker stop
anddocker restart
.The text was updated successfully, but these errors were encountered: