Skip to content

Commit d09aed0

Browse files
committed
More robust
Signed-off-by: Michael Acar <michael.j.acar@gmail.com>
1 parent e424d43 commit d09aed0

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/ray/raylet/worker_pool.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,6 @@ std::tuple<Process, StartupToken> WorkerPool::StartWorkerProcess(
536536
*status = PopWorkerStatus::ArgumentListTooLong;
537537
return {Process(), (StartupToken)-1};
538538
}
539-
// Other errors are fatal to preserve existing behavior.
540539
RAY_LOG(ERROR) << "Failed to start worker process: " << ec.message();
541540
*status = PopWorkerStatus::RuntimeEnvCreationFailed;
542541
return {Process(), (StartupToken)-1};

src/ray/util/process.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,12 +301,16 @@ class ProcessFD {
301301
// Failure: got an error or pipe broke.
302302
ec = std::error_code(bytes_read > 0 ? err_from_child : errno,
303303
std::system_category());
304-
waitpid(pid, NULL, 0);
304+
while (waitpid(pid, NULL, 0) == -1 && errno == EINTR) {
305+
continue;
306+
}
305307
pid = -1;
306308
}
307309
close(status_pipe[0]);
308310
} else {
309-
waitpid(pid, NULL, 0); // Reap intermediate child.
311+
while (waitpid(pid, NULL, 0) == -1 && errno == EINTR) {
312+
continue;
313+
}
310314

311315
// Read the grandchild's PID from the pipe.
312316
ssize_t bytes_read_pid = ReadBytesFromFd(status_pipe[0], &pid, sizeof(pid));

0 commit comments

Comments
 (0)