diff --git a/extern/sector-storage/sched_watch.go b/extern/sector-storage/sched_watch.go index d93cf1af3..2dd9875d7 100644 --- a/extern/sector-storage/sched_watch.go +++ b/extern/sector-storage/sched_watch.go @@ -87,11 +87,14 @@ func (sh *scheduler) runWorkerWatcher() { } log.Warnf("worker %d dropped", wid) - select { - case sh.workerClosing <- wid: - case <-sh.closing: - return - } + // send in a goroutine to avoid a deadlock between workerClosing / watchClosing + go func() { + select { + case sh.workerClosing <- wid: + case <-sh.closing: + return + } + }() } } }