From b045efc2bd0dc259bdf6270e54d59ca903725262 Mon Sep 17 00:00:00 2001 From: "yihao.dai" Date: Tue, 28 Oct 2025 16:36:10 +0800 Subject: [PATCH] fix: Fix panic when gracefully stopping cdc (#45094) issue: https://github.com/milvus-io/milvus/issues/45093, https://github.com/milvus-io/milvus/issues/44123 Signed-off-by: bigsheeper --- internal/distributed/cdc/service.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/internal/distributed/cdc/service.go b/internal/distributed/cdc/service.go index 8229e4b744..d336a8ffb4 100644 --- a/internal/distributed/cdc/service.go +++ b/internal/distributed/cdc/service.go @@ -91,12 +91,8 @@ func (s *Server) stop() { // Stop CDC service. s.cdcServer.Stop() - // Stop etcd - if s.etcdCli != nil { - if err := s.etcdCli.Close(); err != nil { - log.Warn("cdc stop etcd client failed", zap.Error(err)) - } - } + // Don't close s.etcdCli here because it's a shared instance from kvfactory. + // The kvfactory.CloseEtcdClient() will be called in roles.go to close it properly. log.Info("cdc stop done") }