sealing sched: Fix deadlock in worker watcher
This commit is contained in:
parent
f212ca60c8
commit
632fd36205
13
extern/sector-storage/sched_watch.go
vendored
13
extern/sector-storage/sched_watch.go
vendored
@ -87,11 +87,14 @@ func (sh *scheduler) runWorkerWatcher() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
log.Warnf("worker %d dropped", wid)
|
log.Warnf("worker %d dropped", wid)
|
||||||
select {
|
// send in a goroutine to avoid a deadlock between workerClosing / watchClosing
|
||||||
case sh.workerClosing <- wid:
|
go func() {
|
||||||
case <-sh.closing:
|
select {
|
||||||
return
|
case sh.workerClosing <- wid:
|
||||||
}
|
case <-sh.closing:
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user