Skip to content

Commit

Permalink
Exit early when decision map is empty
Browse files Browse the repository at this point in the history
Signed-off-by: Aman Khare <[email protected]>
  • Loading branch information
Aman Khare committed Feb 27, 2024
1 parent b7524ae commit 1ca219c
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,12 @@ public void allocateUnassignedBatch(Set<ShardRouting> shardRoutings, RoutingAllo
if (decisionMap.containsKey(shard)) {
executeDecision(shard, decisionMap.remove(shard), allocation, iterator);
}
} else {
// no need to keep iterating the unassigned shards, if we don't have anything in decision map
break;
}
} catch (Exception e) {
logger.error("Failed to execute decision for shard {} ", shard, e);
logger.error("Failed to execute decision for shard {} while initializing", shard, e);
}
}
}
Expand Down

0 comments on commit 1ca219c

Please sign in to comment.