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 <yihao.dai@zilliz.com>
This commit is contained in:
yihao.dai 2025-10-28 16:36:10 +08:00 committed by GitHub
parent 511a04a6a5
commit b045efc2bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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")
}