Close the no-use chan in the querycoord node (#20385)

Signed-off-by: SimFG <bang.fu@zilliz.com>

Signed-off-by: SimFG <bang.fu@zilliz.com>
pull/20540/head
SimFG 2022-11-08 15:55:02 +08:00 committed by GitHub
parent 3d25a8dc03
commit 6e9820441f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -79,6 +79,9 @@ func (scheduler *Scheduler) schedule(ctx context.Context) {
case <-scheduler.stopCh:
log.Info("JobManager stopped")
for _, queue := range scheduler.queues {
close(queue)
}
return
case job := <-scheduler.waitQueue:
@ -96,6 +99,7 @@ func (scheduler *Scheduler) schedule(ctx context.Context) {
scheduler.startProcessor(collection, queue)
} else {
// Release resource if no job for the collection
close(queue)
delete(scheduler.queues, collection)
}
}