ijuma commented on code in PR #15323:
URL: https://github.com/apache/kafka/pull/15323#discussion_r1489615650


##########
clients/src/main/java/org/apache/kafka/clients/Metadata.java:
##########
@@ -279,7 +286,7 @@ synchronized Optional<MetadataResponse.PartitionMetadata> 
partitionMetadataIfCur
      * @return a mapping from topic names to topic IDs for all topics with 
valid IDs in the cache
      */
     public synchronized Map<String, Uuid> topicIds() {

Review Comment:
   Why is this synchronized? We should avoid synchronized for methods that are 
simply reading a snapshot. Also, are there other methods like this one that 
don't need to be synchronized?



-- 
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