Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ActorInit] Fix Bug in Actor creation #32277

Merged
merged 3 commits into from
Feb 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions python/ray/_raylet.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ from ray.util.scheduling_strategies import (
)
import ray._private.ray_constants as ray_constants
import ray.cloudpickle as ray_pickle
from ray.core.generated.common_pb2 import ActorDiedErrorContext
from ray._private.async_compat import sync_to_async, get_new_event_loop
from ray._private.client_mode_hook import disable_client_hook
import ray._private.gcs_utils as gcs_utils
Expand Down Expand Up @@ -774,10 +775,17 @@ cdef void execute_task(
if len(inspect.getmembers(
actor.__class__,
predicate=inspect.iscoroutinefunction)) == 0:
error_message = (
"Failed to create actor. The failure reason "
"is that you set the async flag, but the actor does not "
"have any coroutine functions.")
raise RayActorError(
f"Failed to create the actor {core_worker.get_actor_id()}. "
"The failure reason is that you set the async flag, "
"but the actor has no any coroutine function.")
ActorDiedErrorContext(
error_message=error_message,
actor_id=core_worker.get_actor_id(),
class_name=class_name
)
)
# Increase recursion limit if necessary. In asyncio mode,
# we have many parallel callstacks (represented in fibers)
# that's suspended for execution. Python interpreter will
Expand Down