Fix close querycoord panic (#14239)

Signed-off-by: dragondriver <jiquan.long@zilliz.com>
This commit is contained in:
Jiquan Long 2021-12-25 17:52:17 +08:00 committed by GitHub
parent d38b6f8445
commit 73c5653c76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -241,11 +241,20 @@ func (qc *QueryCoord) Start() error {
func (qc *QueryCoord) Stop() error {
qc.UpdateStateCode(internalpb.StateCode_Abnormal)
qc.scheduler.Close()
log.Debug("close scheduler ...")
qc.indexChecker.close()
log.Debug("close index checker ...")
qc.loopCancel()
if qc.scheduler != nil {
qc.scheduler.Close()
log.Debug("close scheduler ...")
}
if qc.indexChecker != nil {
qc.indexChecker.close()
log.Debug("close index checker ...")
}
if qc.loopCancel != nil {
qc.loopCancel()
log.Info("cancel the loop of QueryCoord")
}
qc.loopWg.Wait()
qc.session.Revoke(time.Second)