fix: Fix data race in replicate stream client (#45346)

issue: https://github.com/milvus-io/milvus/issues/44123

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
This commit is contained in:
yihao.dai 2025-11-07 10:17:33 +08:00 committed by GitHub
parent 4a6e8d822c
commit 2fad5b34f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -87,11 +87,11 @@ func NewReplicateStreamClient(ctx context.Context, c cluster.MilvusClient, chann
func (r *replicateStreamClient) startInternal() { func (r *replicateStreamClient) startInternal() {
defer func() { defer func() {
r.metrics.OnClose()
close(r.finishedCh)
log.Info("replicate stream client closed", log.Info("replicate stream client closed",
zap.String("key", r.channel.Key), zap.String("key", r.channel.Key),
zap.Int64("revision", r.channel.ModRevision)) zap.Int64("revision", r.channel.ModRevision))
r.metrics.OnClose()
close(r.finishedCh)
}() }()
backoff := backoff.NewExponentialBackOff() backoff := backoff.NewExponentialBackOff()