Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: Rui Qiao <[email protected]>
  • Loading branch information
ruisearch42 committed May 30, 2024
1 parent 81af2bb commit b0ef725
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
14 changes: 6 additions & 8 deletions python/ray/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ class ActorDiedError(RayActorError):

BASE_ERROR_MSG = "The actor died unexpectedly before finishing this task."

def __init__(self, cause: Union[RayTaskError, ActorDiedErrorContext, NodeDeathInfo] = None):
def __init__(self, cause: Union[RayTaskError, ActorDiedErrorContext] = None):
"""
Construct a RayActorError by building the arguments.
"""
Expand All @@ -362,12 +362,6 @@ def __init__(self, cause: Union[RayTaskError, ActorDiedErrorContext, NodeDeathIn
" raised in its creation task, "
f"{cause.__str__()}"
)
elif isinstance(cause, NodeDeathInfo):
error_msg = (
"The actor died because the node was terminated."
)
# FIXME: we don't have actor_id info
# actor_id = ActorID(cause.actor_id).hex()
else:
# Inidicating system-level actor failures.
assert isinstance(cause, ActorDiedErrorContext)
Expand All @@ -388,7 +382,11 @@ def __init__(self, cause: Union[RayTaskError, ActorDiedErrorContext, NodeDeathIn
error_msg_lines.append(
"The actor never ran - it was cancelled before it started running."
)
if cause.preempted:
if (
cause.node_death_info
and cause.node_death_info.reason
== NodeDeathInfo.AUTOSCALER_DRAIN_PREEMPTED
):
preempted = True
error_msg_lines.append(
"\tThe actor's node was killed by a spot preemption."
Expand Down
4 changes: 2 additions & 2 deletions src/ray/gcs/gcs_server/gcs_actor_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ const ray::rpc::ActorDeathCause GcsActorManager::GenNodeDiedCause(
// TODO(vitsai): Publish this information as well
if (auto death_info = node->death_info();
death_info.reason() == rpc::NodeDeathInfo::AUTOSCALER_DRAIN_PREEMPTED) {
auto node_death_info = actor_died_error_ctx->mutable_node_death_info();
node_death_info->CopyFrom(node->death_info());
auto node_death_info = actor_died_error_ctx->mutable_node_death_info();
node_death_info->CopyFrom(node->death_info());
}
return death_cause;
}
Expand Down

0 comments on commit b0ef725

Please sign in to comment.