Signal actor failure (#4196)

This commit is contained in:
Ion
2019-03-21 15:17:42 -07:00
committed by Philipp Moritz
parent c36d03874b
commit 59079a799c
4 changed files with 86 additions and 8 deletions
+14 -2
View File
@@ -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,