remove open windows when dropping workers
This commit is contained in:
parent
7f115954fd
commit
045e597787
10
sched.go
10
sched.go
@ -528,6 +528,16 @@ func (sh *scheduler) dropWorker(wid WorkerID) {
|
|||||||
w := sh.workers[wid]
|
w := sh.workers[wid]
|
||||||
delete(sh.workers, wid)
|
delete(sh.workers, wid)
|
||||||
|
|
||||||
|
newWindows := make([]*schedWindowRequest, 0, len(sh.openWindows))
|
||||||
|
for _, window := range sh.openWindows {
|
||||||
|
if window.worker != wid {
|
||||||
|
newWindows = append(newWindows, window)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sh.openWindows = newWindows
|
||||||
|
|
||||||
|
// TODO: sync close worker goroutine
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
if err := w.w.Close(); err != nil {
|
if err := w.w.Close(); err != nil {
|
||||||
log.Warnf("closing worker %d: %+v", err)
|
log.Warnf("closing worker %d: %+v", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user