mirror of https://github.com/milvus-io/milvus.git
Fix do unsolved msg goroutine not release (#14536)
Signed-off-by: godchen0212 <qingxiang.chen@zilliz.com>pull/14554/head
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…
Reference in New Issue