From 170e08cf028600be10daa83e8f6642d8620dbb5c Mon Sep 17 00:00:00 2001 From: Hao Chen Date: Fri, 10 Aug 2018 08:57:25 +0800 Subject: [PATCH] fix a bug in killing unregistered workers (#2613) --- src/ray/raylet/worker_pool.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ray/raylet/worker_pool.cc b/src/ray/raylet/worker_pool.cc index 24ee3bd76..e1dd34a0e 100644 --- a/src/ray/raylet/worker_pool.cc +++ b/src/ray/raylet/worker_pool.cc @@ -65,11 +65,14 @@ WorkerPool::~WorkerPool() { } // Kill all the workers that have been started but not registered. for (const auto &entry : starting_worker_processes_) { - pids_to_kill.insert(entry.second); + pids_to_kill.insert(entry.first); } for (const auto &pid : pids_to_kill) { RAY_CHECK(pid > 0); kill(pid, SIGKILL); + } + // Waiting for the workers to be killed + for (const auto &pid : pids_to_kill) { waitpid(pid, NULL, 0); } }