From 6e9820441f7d13111f95459d8ddaf6ccd9b42747 Mon Sep 17 00:00:00 2001 From: SimFG Date: Tue, 8 Nov 2022 15:55:02 +0800 Subject: [PATCH] Close the no-use chan in the querycoord node (#20385) Signed-off-by: SimFG Signed-off-by: SimFG --- internal/querycoordv2/job/scheduler.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/querycoordv2/job/scheduler.go b/internal/querycoordv2/job/scheduler.go index f1d500f092..a89fd8936e 100644 --- a/internal/querycoordv2/job/scheduler.go +++ b/internal/querycoordv2/job/scheduler.go @@ -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) } }