diff options
author | Valery Piashchynski <[email protected]> | 2021-11-07 22:21:18 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-11-07 22:21:18 +0300 |
commit | ecdcee628744e7371eda50ab6f1d3c7c13e8d7c9 (patch) | |
tree | edcc3d1265df61ad0a7c614b3ff97646c4037797 | |
parent | 1bbf4a472cc476dafe14710c188748a9be8186e0 (diff) |
kill the worker received from the channelv2.6.0-alpha.5
Signed-off-by: Valery Piashchynski <[email protected]>
-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 } /* |