diff options
Diffstat (limited to 'worker_watcher')
-rw-r--r-- | worker_watcher/container/channel/vec.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/worker_watcher/container/channel/vec.go b/worker_watcher/container/channel/vec.go index 3dfe855e..958a217c 100644 --- a/worker_watcher/container/channel/vec.go +++ b/worker_watcher/container/channel/vec.go @@ -49,6 +49,7 @@ func (v *Vec) Push(w worker.BaseProcess) { We need to drain vector until we found a worker in the Invalid/Killing/Killed/etc states. */ wrk := <-v.workers + switch wrk.State().Value() { // good states case worker.StateWorking, worker.StateReady: @@ -62,6 +63,10 @@ func (v *Vec) Push(w worker.BaseProcess) { // kill the new worker and reallocate it w.State().Set(worker.StateInvalid) _ = w.Kill() + + // kill the worker from the channel + wrk.State().Set(worker.StateInvalid) + _ = wrk.Kill() continue } /* |