diff --git a/src/ray/core_worker/core_worker.cc b/src/ray/core_worker/core_worker.cc index 26316036d..97b8327d4 100644 --- a/src/ray/core_worker/core_worker.cc +++ b/src/ray/core_worker/core_worker.cc @@ -1917,7 +1917,10 @@ void CoreWorker::HandleCancelTask(const rpc::CancelTaskRequest &request, if (options_.log_dir != "") { RayLog::ShutDownRayLog(); } - exit(1); + // NOTE(hchen): Use `_Exit()` to force-exit this process without doing cleanup. + // `exit()` will destruct static objects in an incorrect order, which will lead to + // core dumps. + _Exit(1); } } @@ -1953,7 +1956,10 @@ void CoreWorker::HandleKillActor(const rpc::KillActorRequest &request, if (options_.log_dir != "") { RayLog::ShutDownRayLog(); } - exit(1); + // NOTE(hchen): Use `_Exit()` to force-exit this process without doing cleanup. + // `exit()` will destruct static objects in an incorrect order, which will lead to + // core dumps. + _Exit(1); } else { Exit(/*intentional=*/true); }