mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-02-02 01:06:41 +08:00
Fix do unsolved msg goroutine not release (#14536)
Signed-off-by: godchen0212 <qingxiang.chen@zilliz.com>
This commit is contained in:
parent
e045f35440
commit
eb7dcf9ed3
@ -266,6 +266,10 @@ func (q *queryCollection) waitNewTSafe() (Timestamp, error) {
|
||||
q.watcherCond.L.Lock()
|
||||
for !q.tSafeUpdate {
|
||||
q.watcherCond.Wait()
|
||||
err := q.releaseCtx.Err()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
}
|
||||
q.tSafeUpdate = false
|
||||
q.watcherCond.Broadcast()
|
||||
@ -574,6 +578,9 @@ func (q *queryCollection) doUnsolvedQueryMsg() {
|
||||
//time.Sleep(10 * time.Millisecond)
|
||||
serviceTime, err := q.waitNewTSafe()
|
||||
if err != nil {
|
||||
if err == q.releaseCtx.Err() {
|
||||
continue
|
||||
}
|
||||
log.Error("[should not happen!] stop doUnsolvedMsg, err = " + err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
@ -164,5 +164,7 @@ func (q *queryService) stopQueryCollection(collectionID UniqueID) {
|
||||
}
|
||||
sc.close()
|
||||
sc.cancel()
|
||||
// for not blocking waitNewTsafe, which will block doUnsolvedMsg quit.
|
||||
sc.watcherCond.Broadcast()
|
||||
delete(q.queryCollections, collectionID)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user