smjn commented on code in PR #22412:
URL: https://github.com/apache/kafka/pull/22412#discussion_r3356696691


##########
server/src/main/java/org/apache/kafka/server/share/dlq/ShareGroupDLQStateManager.java:
##########
@@ -154,6 +168,11 @@ CompletableFuture<Void> dlq(ShareGroupDLQRecordParameter 
param, long requestBack
         return future;
     }
 
+    // Visibility for tests
+    Map<Node, List<ShareGroupDLQStateManager.ProduceRequestHandler>> 
nodeRPCMap() {
+        return Collections.unmodifiableMap(nodeRPCMap);

Review Comment:
   Hi @apoorvmittal10 ,
   Thanks for the suggestion but
   `Map.copyOf` is causing flakiness as its a heavy operation on the map and 
the condition we are waiting upon might change before are able to check it. 
Since the method `nodeRPCMap` is only for test consumption, 
`Collections.unmodifiableMap` provides sufficient protection.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to