summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-11-07 22:21:18 +0300
committerValery Piashchynski <[email protected]>2021-11-07 22:22:37 +0300
commit536c6300b9627138ef957c31a08bcd5339c21b30 (patch)
tree0ff8b7846e3262209aa5b9c3fda4f824f8fbfd1d
parent2f727a7b3f1587c65eb5ab3a32287ee628cbbc99 (diff)
kill the worker received from the channelv2.5.3
Signed-off-by: Valery Piashchynski <[email protected]>
-rw-r--r--worker_watcher/container/channel/vec.go5
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
}
/*