Skip to content

Commit

Permalink
Fix Stack Overflow in UnassignedInfo in Corner Case (#76480)
Browse files Browse the repository at this point in the history
We kept wrapping the collection over and over again which in extreme corner cases could lead to a SOE.

Closes #76490
  • Loading branch information
hanbj committed Aug 16, 2021
1 parent f4e3f33 commit 1d8bad6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public UnassignedInfo(Reason reason, @Nullable String message, @Nullable Excepti
this.failure = failure;
this.failedAllocations = failedAllocations;
this.lastAllocationStatus = Objects.requireNonNull(lastAllocationStatus);
this.failedNodeIds = Collections.unmodifiableSet(failedNodeIds);
this.failedNodeIds = Set.copyOf(failedNodeIds);
assert (failedAllocations > 0) == (reason == Reason.ALLOCATION_FAILED) :
"failedAllocations: " + failedAllocations + " for reason " + reason;
assert (message == null && failure != null) == false : "provide a message if a failure exception is provided";
Expand Down

0 comments on commit 1d8bad6

Please sign in to comment.