Skip to content

Commit

Permalink
Fix mac build (ray-project#43546)
Browse files Browse the repository at this point in the history
The previous PR doesn't fix all the places.

Co-authored-by: Cuong Nguyen <[email protected]>
  • Loading branch information
fishbone and can-anyscale committed Feb 29, 2024
1 parent a54f0fc commit 75bde90
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ray/raylet/local_task_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ bool LocalTaskManager::ReleaseCpuResourcesFromBlockedWorker(

bool cpu_resources_released = false;
if (worker->GetAllocatedInstances() != nullptr) {
for (const auto resource_id : worker->GetAllocatedInstances()->ResourceIds()) {
for (const auto &resource_id : worker->GetAllocatedInstances()->ResourceIds()) {
if (IsCPUOrPlacementGroupCPUResource(resource_id)) {
auto cpu_instances = worker->GetAllocatedInstances()->GetDouble(resource_id);
cluster_resource_scheduler_->GetLocalResourceManager().AddResourceInstances(
Expand Down Expand Up @@ -1027,7 +1027,7 @@ bool LocalTaskManager::ReturnCpuResourcesToUnblockedWorker(

bool cpu_resources_returned = false;
if (worker->GetAllocatedInstances() != nullptr) {
for (const auto resource_id : worker->GetAllocatedInstances()->ResourceIds()) {
for (const auto &resource_id : worker->GetAllocatedInstances()->ResourceIds()) {
if (IsCPUOrPlacementGroupCPUResource(resource_id)) {
auto cpu_instances = worker->GetAllocatedInstances()->GetDouble(resource_id);
// Important: we allow going negative here, since otherwise you can use infinite
Expand Down Expand Up @@ -1071,7 +1071,7 @@ ResourceSet LocalTaskManager::CalcNormalTaskResources() const {
auto resource_set = allocated_instances->ToResourceSet();
// Blocked normal task workers have temporarily released its allocated CPU.
if (worker->IsBlocked()) {
for (const auto resource_id : allocated_instances->ResourceIds()) {
for (const auto &resource_id : allocated_instances->ResourceIds()) {
if (IsCPUOrPlacementGroupCPUResource(resource_id)) {
resource_set.Set(resource_id, 0);
}
Expand Down

0 comments on commit 75bde90

Please sign in to comment.