mirror of
https://github.com/wassname/ray.git
synced 2026-07-10 08:36:27 +08:00
Reconstruct failed actors without sending tasks. (#5161)
* fast reconstruct dead actors * add test * fix typos * remove debug print * small fix * fix typos * Update test_actor.py
This commit is contained in:
@@ -655,6 +655,10 @@ void NodeManager::HandleActorStateTransition(const ActorID &actor_id,
|
||||
<< actor_registration.GetRemainingReconstructions();
|
||||
|
||||
if (actor_registration.GetState() == ActorTableData::ALIVE) {
|
||||
// The actor is now alive (created for the first time or reconstructed). We can
|
||||
// stop listening for the actor creation task. This is needed because we use
|
||||
// `ListenAndMaybeReconstruct` to reconstruct the actor.
|
||||
reconstruction_policy_.Cancel(actor_registration.GetActorCreationDependency());
|
||||
// The actor's location is now known. Dequeue any methods that were
|
||||
// submitted before the actor's location was known.
|
||||
// (See design_docs/task_states.rst for the state transition diagram.)
|
||||
@@ -692,6 +696,10 @@ void NodeManager::HandleActorStateTransition(const ActorID &actor_id,
|
||||
} else {
|
||||
RAY_CHECK(actor_registration.GetState() == ActorTableData::RECONSTRUCTING);
|
||||
RAY_LOG(DEBUG) << "Actor is being reconstructed: " << actor_id;
|
||||
// The actor is dead and needs reconstruction. Attempting to reconstruct its
|
||||
// creation task.
|
||||
reconstruction_policy_.ListenAndMaybeReconstruct(
|
||||
actor_registration.GetActorCreationDependency());
|
||||
// When an actor fails but can be reconstructed, resubmit all of the queued
|
||||
// tasks for that actor. This will mark the tasks as waiting for actor
|
||||
// creation.
|
||||
@@ -2056,8 +2064,8 @@ void NodeManager::HandleTaskReconstruction(const TaskID &task_id) {
|
||||
// The task was not in the GCS task table. It must therefore be in the
|
||||
// lineage cache.
|
||||
RAY_CHECK(lineage_cache_.ContainsTask(task_id))
|
||||
<< "Task metadata not found in either GCS or lineage cache. It may have been "
|
||||
"evicted "
|
||||
<< "Metadata of task " << task_id
|
||||
<< " not found in either GCS or lineage cache. It may have been evicted "
|
||||
<< "by the redis LRU configuration. Consider increasing the memory "
|
||||
"allocation via "
|
||||
<< "ray.init(redis_max_memory=<max_memory_bytes>).";
|
||||
|
||||
Reference in New Issue
Block a user