remove open windows when dropping workers

This commit is contained in:
Łukasz Magiera 2020-07-11 01:21:48 +02:00
parent 7f115954fd
commit 045e597787

View File

@ -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)