SetErrorMode for all Ray processes (#8656)

This commit is contained in:
mehrdadn 2020-05-29 08:18:20 -07:00 committed by GitHub
parent 35eeec5647
commit cb91fe2fc4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View file

@ -66,12 +66,7 @@ WorkerPool::WorkerPool(boost::asio::io_service &io_service, int num_workers,
raylet_config_(raylet_config),
starting_worker_timeout_callback_(starting_worker_timeout_callback) {
RAY_CHECK(maximum_startup_concurrency > 0);
#ifdef _WIN32
// If worker processes fail to initialize, don't display an error window.
SetErrorMode(GetErrorMode() | SEM_FAILCRITICALERRORS);
// If worker processes crash, don't display an error window.
SetErrorMode(GetErrorMode() | SEM_NOGPFAULTERRORBOX);
#else
#ifndef _WIN32
// Ignore SIGCHLD signals. If we don't do this, then worker processes will
// become zombies instead of dying gracefully.
signal(SIGCHLD, SIG_IGN);

View file

@ -214,6 +214,12 @@ void RayLog::ShutDownRayLog() {
}
void RayLog::InstallFailureSignalHandler() {
#ifdef _WIN32
// If process fails to initialize, don't display an error window.
SetErrorMode(GetErrorMode() | SEM_FAILCRITICALERRORS);
// If process crashes, don't display an error window.
SetErrorMode(GetErrorMode() | SEM_NOGPFAULTERRORBOX);
#endif
#ifdef RAY_USE_GLOG
if (is_failure_signal_handler_installed_) {
return;