mirror of
https://github.com/wassname/ray.git
synced 2026-08-04 13:14:14 +08:00
Signal actor failure (#4196)
This commit is contained in:
@@ -502,8 +502,20 @@ void NodeManager::PublishActorStateTransition(
|
||||
// RECONSTRUCTING or DEAD entries have an odd index.
|
||||
log_length += 1;
|
||||
}
|
||||
RAY_CHECK_OK(gcs_client_->actor_table().AppendAt(
|
||||
JobID::nil(), actor_id, actor_notification, nullptr, failure_callback, log_length));
|
||||
// If we successful appended a record to the GCS table of the actor that
|
||||
// has died, signal this to anyone receiving signals from this actor.
|
||||
auto success_callback = [](gcs::AsyncGcsClient *client, const ActorID &id,
|
||||
const ActorTableDataT &data) {
|
||||
auto redis_context = client->primary_context();
|
||||
if (data.state == ActorState::DEAD || data.state == ActorState::RECONSTRUCTING) {
|
||||
std::vector<std::string> args = {"XADD", id.hex(), "*", "signal",
|
||||
"ACTOR_DIED_SIGNAL"};
|
||||
RAY_CHECK_OK(redis_context->RunArgvAsync(args));
|
||||
}
|
||||
};
|
||||
RAY_CHECK_OK(gcs_client_->actor_table().AppendAt(JobID::nil(), actor_id,
|
||||
actor_notification, success_callback,
|
||||
failure_callback, log_length));
|
||||
}
|
||||
|
||||
void NodeManager::HandleActorStateTransition(const ActorID &actor_id,
|
||||
|
||||
Reference in New Issue
Block a user