From a950e95c7d38df32311da90b20208e2d35b7aa08 Mon Sep 17 00:00:00 2001 From: Edward Oakes Date: Mon, 13 Jan 2020 11:37:59 -0600 Subject: [PATCH] Use exit() in __kill_actor__ (#6760) --- python/ray/tests/test_actor.py | 6 +++--- src/ray/core_worker/core_worker.cc | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/python/ray/tests/test_actor.py b/python/ray/tests/test_actor.py index cd156667a..2f5abe95d 100644 --- a/python/ray/tests/test_actor.py +++ b/python/ray/tests/test_actor.py @@ -1413,12 +1413,12 @@ def test_kill(ray_start_regular): @ray.remote class Actor: def hang(self): - # Never returns. - ray.get(ray.ObjectID.from_random()) + while True: + time.sleep(1) actor = Actor.remote() result = actor.hang.remote() - ready, _ = ray.wait([result], timeout=0.1) + ready, _ = ray.wait([result], timeout=0.5) assert len(ready) == 0 actor.__ray_kill__() with pytest.raises(ray.exceptions.RayActorError): diff --git a/src/ray/core_worker/core_worker.cc b/src/ray/core_worker/core_worker.cc index 0ae140469..66e5aafbf 100644 --- a/src/ray/core_worker/core_worker.cc +++ b/src/ray/core_worker/core_worker.cc @@ -1153,8 +1153,11 @@ void CoreWorker::HandleKillActor(const rpc::KillActorRequest &request, send_reply_callback(Status::Invalid(msg), nullptr, nullptr); return; } - RAY_LOG(INFO) << "Got KillActor, shutting down..."; - Shutdown(); + RAY_LOG(INFO) << "Got KillActor, exiting immediately..."; + if (log_dir_ != "") { + RayLog::ShutDownRayLog(); + } + exit(1); } void CoreWorker::HandleGetCoreWorkerStats(const rpc::GetCoreWorkerStatsRequest &request,