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

[Placement Group]Add detached support for placement group. #13582

Merged
merged 18 commits into from
Jan 27, 2021
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
fix comment issue
  • Loading branch information
clay4megtr committed Jan 21, 2021
commit 0df8a4d90e405cca37bfb2ae385285bb863dc429
8 changes: 4 additions & 4 deletions src/ray/gcs/gcs_server/gcs_placement_group_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ void GcsPlacementGroup::MarkCreatorActorDead() {
placement_group_table_data_.set_creator_actor_dead(true);
}

bool GcsPlacementGroup::IsPlacementGroupRemovable() const {
return placement_group_table_data_.creator_job_dead() &&
bool GcsPlacementGroup::IsPlacementGroupLifetimeDone() const {
return !IsDetached() && placement_group_table_data_.creator_job_dead() &&
placement_group_table_data_.creator_actor_dead();
}

Expand Down Expand Up @@ -497,7 +497,7 @@ void GcsPlacementGroupManager::CleanPlacementGroupIfNeededWhenJobDead(
continue;
}
placement_group->MarkCreatorJobDead();
if (placement_group->IsPlacementGroupRemovable()) {
if (placement_group->IsPlacementGroupLifetimeDone()) {
RemovePlacementGroup(placement_group->GetPlacementGroupID(), [](Status status) {});
}
}
Expand All @@ -511,7 +511,7 @@ void GcsPlacementGroupManager::CleanPlacementGroupIfNeededWhenActorDead(
continue;
}
placement_group->MarkCreatorActorDead();
if (!placement_group->IsDetached() && placement_group->IsPlacementGroupRemovable()) {
if (placement_group->IsPlacementGroupLifetimeDone()) {
RemovePlacementGroup(placement_group->GetPlacementGroupID(), [](Status status) {});
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/ray/gcs/gcs_server/gcs_placement_group_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ class GcsPlacementGroup {
/// Mark that the creator actor of this placement group is dead.
void MarkCreatorActorDead();

/// Return True if the placement group is removable. False otherwise.
bool IsPlacementGroupRemovable() const;
/// Return True if the placement group lifetime is done. False otherwise.
bool IsPlacementGroupLifetimeDone() const;

/// Returns whether or not this is a detached placement group.
bool IsDetached() const;
Expand Down