From 684a63b698745158f6cc5a1d61a89bb36e9f3bf5 Mon Sep 17 00:00:00 2001 From: "zhenshan.cao" Date: Sat, 25 Dec 2021 13:36:19 +0800 Subject: [PATCH] Fix bug:wait for search finish when stop querynode (#14228) Signed-off-by: zhenshan.cao --- internal/querynode/collection_replica.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/querynode/collection_replica.go b/internal/querynode/collection_replica.go index 07f221da62..528dbc134f 100644 --- a/internal/querynode/collection_replica.go +++ b/internal/querynode/collection_replica.go @@ -665,8 +665,10 @@ func (colReplica *collectionReplica) getExcludedSegments(collectionID UniqueID) // freeAll will free all meta info from collectionReplica func (colReplica *collectionReplica) freeAll() { + colReplica.queryMu.Lock() // wait for current search/query finish colReplica.mu.Lock() defer colReplica.mu.Unlock() + defer colReplica.queryMu.Unlock() for id := range colReplica.collections { _ = colReplica.removeCollectionPrivate(id)