From 3516334ebb09fa3337cc5d9515b0f7f7a8a5cff8 Mon Sep 17 00:00:00 2001 From: mmsqe Date: Thu, 4 Dec 2025 01:45:43 +0800 Subject: [PATCH] fix: add missing close when graceful shutdown (#25632) Co-authored-by: Alex | Cosmos Labs --- CHANGELOG.md | 1 + server/start.go | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35ed1ab7f7..d762834647 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -73,6 +73,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (collections) [#25464](https://github.com/cosmos/cosmos-sdk/pull/25464) Add `IterateRaw` method to `Multi` index type to satisfty query `Collection` interface. * (x/mint) [#25562](https://github.com/cosmos/cosmos-sdk/pull/25562) Improve and test `x/mint` params validation. * (api) [#25613](https://github.com/cosmos/cosmos-sdk/pull/25613) Separated deprecated modules into the contrib directory, distinct from api, to enable and unblock new proto changes without affecting legacy code. +* (server) [#25632](https://github.com/cosmos/cosmos-sdk/pull/25632) Add missing call to close the app on shutdown. ### Bug Fixes diff --git a/server/start.go b/server/start.go index 883afa618b..a3b21e5df7 100644 --- a/server/start.go +++ b/server/start.go @@ -3,6 +3,7 @@ package server import ( "bufio" "context" + "errors" "fmt" "io" "net" @@ -304,7 +305,7 @@ func startStandAlone(svrCtx *Context, svrCfg serverconfig.Config, clientCtx clie // so we can gracefully stop the ABCI server. <-ctx.Done() svrCtx.Logger.Info("stopping the ABCI server...") - return svr.Stop() + return errors.Join(svr.Stop(), app.Close()) }) return g.Wait() @@ -400,6 +401,7 @@ func startCmtNode( cleanupFn = func() { if tmNode != nil && tmNode.IsRunning() { _ = tmNode.Stop() + _ = app.Close() } }