Fix core dumps in ExitActor (#8382)

This commit is contained in:
Hao Chen 2020-05-12 20:06:04 +08:00 committed by GitHub
parent 57544b1ff9
commit a593fde606
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
}