Skip to content

Commit

Permalink
Fix Deeply Nesting UnmodifableSet Wrappers in UnassignedInfo
Browse files Browse the repository at this point in the history
The linked issue is pretty fringe, but even during normal operation we keep nesting these wrappers a bunch of

closes elastic#76490
  • Loading branch information
original-brownbear committed Aug 14, 2021
1 parent 58eefdd commit 23cb615
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 23cb615

Please sign in to comment.