From 9c6d892eec114ebef8df707320b8e8114feb1d63 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Thu, 14 Jan 2021 08:38:01 -0800 Subject: [PATCH] [ray_client]: fix exceptions raised while executing on the server on behalf of the client (#13424) --- python/ray/tests/test_actor.py | 5 +++++ python/ray/util/client/server/server.py | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/python/ray/tests/test_actor.py b/python/ray/tests/test_actor.py index 1aafcd04f..cc252d24d 100644 --- a/python/ray/tests/test_actor.py +++ b/python/ray/tests/test_actor.py @@ -855,6 +855,11 @@ def test_inherit_actor_from_class(ray_start_regular_shared): assert ray.get(actor.g.remote(5)) == 6 +def test_get_non_existing_named_actor(ray_start_regular_shared): + with pytest.raises(ValueError): + _ = ray.get_actor("non_existing_actor") + + @pytest.mark.skip( "This test is just used to print the latency of creating 100 actors.") def test_actor_creation_latency(ray_start_regular_shared): diff --git a/python/ray/util/client/server/server.py b/python/ray/util/client/server/server.py index 8ef8c963f..cf095a137 100644 --- a/python/ray/util/client/server/server.py +++ b/python/ray/util/client/server/server.py @@ -261,8 +261,7 @@ class RayletServicer(ray_client_pb2_grpc.RayletDriverServicer): result.valid = True return result except Exception as e: - logger.error(f"Caught schedule exception {e}") - raise e + logger.debug(f"Caught schedule exception, returning: {e}") return ray_client_pb2.ClientTaskTicket( valid=False, error=cloudpickle.dumps(e))