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); } }