-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Bug]: simapp and Network do not invoke Close()
#18151
Comments
Server is calling close on interrupt signal, which means that SimApp is calling it: https://github.com/cosmos/cosmos-sdk/blob/release/v0.47.x/server/start.go#L256 |
The |
Also, I noticed that if I update the default implementation of BaseApp#Close to log an error and panic, neither the log statement or panic show-up in the simulator output when invoking |
I believe the issue I was seeing was that If we look at startStandAlone() we can see that |
True, your last point has been fixed on v0.50 and main already. I'll just add move up the defer for v0.47. |
Thanks |
Is there an existing issue for this?
What happened?
I was looking for a shutdown hook that I can use in a Cosmos application. I found the Close() method that was added but noticed that it is not invoked during Network#Cleanup() and it also doesn't look like
simapp
callsClose()
either.Furthermore it looks like
simapp
does use testutil/testnet/nodes.go which utilize CometBFT Service#Stop().Network and
simapp
should invoke theClose()
shutdown hook.[Optionally] Cosmos SDK should integrate into CometBFTs shutdown hook (OnStop() override OR Quit() channel) instead of re-inventing the wheel.
Cosmos SDK Version
0.47.4
How to reproduce?
Tests written using simapp / Network do not invoke the shutdown hook.
The text was updated successfully, but these errors were encountered: