mirror of
https://github.com/wassname/ray.git
synced 2026-07-13 01:51:51 +08:00
fix a bug in killing unregistered workers (#2613)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user