Update sched_worker.go

Avoid possible deadlock by sh.workersLk
This commit is contained in:
liismn 2020-12-25 15:05:01 +08:00 committed by GitHub
parent bb5a92e2f4
commit e9cc697ee8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,6 +57,7 @@ func (sh *scheduler) runWorker(ctx context.Context, w Worker) error {
log.Warnw("duplicated worker added", "id", wid)
// this is ok, we're already handling this worker in a different goroutine
sh.workersLk.Unlock()
return nil
}