Skip to content

Commit

Permalink
[INLONG-11453][SDK] notifyHBControl function array out of bounds (#11454
Browse files Browse the repository at this point in the history
)



Co-authored-by: gosonzhang <[email protected]>
  • Loading branch information
gosonzhang and gosonzhang authored Nov 5, 2024
1 parent 8b8faa6 commit d9fd8bf
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -770,9 +770,7 @@ public int compare(Map.Entry<HostInfo, Integer> o1, Map.Entry<HostInfo, Integer>
logger.info("HBClient:" + item.getKey() + ";" + item.getValue());
}
boolean isLoadSwitch = false;

// int smallSize = listData.size() < listHB.size() ? listData.size() : listHB.size();
int smallSize = 1;
int smallSize = Math.min(Math.min(listData.size(), listHB.size()), 1);
for (int i = 0; i < smallSize; i++) {
if ((listData.get(i).getValue() - listHB.get(i).getValue()) >= this.loadThreshold) {
isLoadSwitch = true;
Expand Down

0 comments on commit d9fd8bf

Please sign in to comment.