sched: Fix tests
This commit is contained in:
parent
7fe8580da5
commit
5a2b439773
7
extern/sector-storage/sched.go
vendored
7
extern/sector-storage/sched.go
vendored
@ -774,14 +774,19 @@ func (sh *scheduler) dropWorker(wid WorkerID) {
|
||||
}
|
||||
|
||||
func (sh *scheduler) workerCleanup(wid WorkerID, w *workerHandle) {
|
||||
if !w.cleanupStarted {
|
||||
select {
|
||||
case <-w.closingMgr:
|
||||
default:
|
||||
close(w.closingMgr)
|
||||
}
|
||||
|
||||
sh.workersLk.Unlock()
|
||||
select {
|
||||
case <-w.closedMgr:
|
||||
case <-time.After(time.Second):
|
||||
log.Errorf("timeout closing worker manager goroutine %d", wid)
|
||||
}
|
||||
sh.workersLk.Lock()
|
||||
|
||||
if !w.cleanupStarted {
|
||||
w.cleanupStarted = true
|
||||
|
Loading…
Reference in New Issue
Block a user