Fix panic when close IndexCoord (#14611)

Signed-off-by: dragondriver <jiquan.long@zilliz.com>
pull/14743/head
Jiquan Long 2022-01-04 10:19:18 +08:00 committed by GitHub
parent 4b4e29df92
commit 4f71fff388
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 2 deletions

View File

@ -291,9 +291,18 @@ func (i *IndexCoord) Stop() error {
// https://github.com/milvus-io/milvus/issues/12282
i.UpdateStateCode(internalpb.StateCode_Abnormal)
i.loopCancel()
i.sched.Close()
if i.loopCancel != nil {
i.loopCancel()
log.Info("cancel the loop of IndexCoord")
}
if i.sched != nil {
i.sched.Close()
log.Info("close the task scheduler of IndexCoord")
}
i.loopWg.Wait()
for _, cb := range i.closeCallbacks {
cb()
}