Fix memory & goroutine leak (#20152)

Signed-off-by: yah01 <yang.cen@zilliz.com>

Signed-off-by: yah01 <yang.cen@zilliz.com>
pull/20174/head
yah01 2022-10-28 14:55:32 +08:00 committed by GitHub
parent 89541a6f68
commit 8bfa55e560
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -115,6 +115,7 @@ func (controller *CheckerController) check(ctx context.Context) {
for _, task := range tasks {
err := controller.scheduler.Add(task)
if err != nil {
task.Cancel()
continue
}
added++

View File

@ -125,6 +125,7 @@ func (s *Server) balanceSegments(ctx context.Context, req *querypb.LoadBalanceRe
)
err := s.taskScheduler.Add(task)
if err != nil {
task.Cancel()
return err
}
tasks = append(tasks, task)