mirror of
https://github.com/vale981/ray
synced 2025-03-08 11:31:40 -05:00
fix a bug in killing unregistered workers (#2613)
This commit is contained in:
parent
143a118fbf
commit
170e08cf02
1 changed files with 4 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue