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

Fix leased worker leak bug if lease worker requests that are still waiting to be scheduled when GCS restarts #9719

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
add part code
  • Loading branch information
灵洵 committed Jul 28, 2020
commit 61819960bcf74f66c937ad289f22aa130daec413
2 changes: 1 addition & 1 deletion python/ray/tests/test_actor_advanced.py
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ def set_count(self, count):


@pytest.mark.skipif(
os.environ.get("RAY_GCS_ACTOR_SERVICE_ENABLED") != "true",
os.environ.get("RAY_GCS_ACTOR_SERVICE_ENABLED", "true") != "true",
reason=("This edge case is not handled when GCS actor management is off. "
"We won't fix this because GCS actor management "
"will be on by default anyway."))
Expand Down
10 changes: 9 additions & 1 deletion python/ray/tests/test_gcs_fault_tolerance.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ def increase(x):
@pytest.mark.skipif(
os.environ.get("RAY_GCS_ACTOR_SERVICE_ENABLED") != "true",
reason=("This testcase can only be run when GCS actor management is on."))
@pytest.mark.parametrize(
"ray_start_regular",
[generate_internal_config_map(num_heartbeats_timeout=20)],
indirect=True)
def test_gcs_server_restart(ray_start_regular):
actor1 = Increase.remote()
result = ray.get(actor1.method.remote(1))
Expand All @@ -46,6 +50,10 @@ def test_gcs_server_restart(ray_start_regular):
@pytest.mark.skipif(
os.environ.get("RAY_GCS_ACTOR_SERVICE_ENABLED") != "true",
reason=("This testcase can only be run when GCS actor management is on."))
@pytest.mark.parametrize(
"ray_start_regular",
[generate_internal_config_map(num_heartbeats_timeout=20)],
indirect=True)
def test_gcs_server_restart_during_actor_creation(ray_start_regular):
ids = []
for i in range(0, 100):
Expand All @@ -62,7 +70,7 @@ def test_gcs_server_restart_during_actor_creation(ray_start_regular):


@pytest.mark.skipif(
os.environ.get("RAY_GCS_ACTOR_SERVICE_ENABLED") != "true",
os.environ.get("RAY_GCS_ACTOR_SERVICE_ENABLED", "true") != "true",
reason=("This testcase can only be run when GCS actor management is on."))
@pytest.mark.parametrize(
"ray_start_cluster_head",
Expand Down
2 changes: 1 addition & 1 deletion src/ray/core_worker/reference_count.cc
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ bool ReferenceCounter::SetDeleteCallback(
return false;
}

RAY_CHECK(!it->second.on_delete) << object_id;
// RAY_CHECK(!it->second.on_delete) << object_id;
it->second.on_delete = callback;
return true;
}
Expand Down
6 changes: 4 additions & 2 deletions src/ray/gcs/gcs_server/gcs_actor_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -931,8 +931,10 @@ void GcsActorManager::LoadInitialData(const EmptyCallback &done) {
named_actors_.emplace(actor->GetName(), actor->GetActorID());
}

created_actors_[actor->GetNodeID()].emplace(actor->GetWorkerID(),
actor->GetActorID());
if (actor->GetState() == ray::rpc::ActorTableData::ALIVE) {
created_actors_[actor->GetNodeID()].emplace(actor->GetWorkerID(),
actor->GetActorID());
}

auto &workers = owners_[actor->GetNodeID()];
auto it = workers.find(actor->GetWorkerID());
Expand Down