You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/12/02 00:08:28 UTC

[GitHub] [kafka] HyunSangHan commented on a change in pull request #11418: MINOR: Write log differently according to the size of missingListenerPartitions

HyunSangHan commented on a change in pull request #11418:
URL: https://github.com/apache/kafka/pull/11418#discussion_r760666349



##########
File path: clients/src/main/java/org/apache/kafka/clients/NetworkClient.java
##########
@@ -1080,8 +1080,13 @@ public void handleSuccessfulResponse(RequestHeader requestHeader, long now, Meta
                 .collect(Collectors.toList());
             if (!missingListenerPartitions.isEmpty()) {
                 int count = missingListenerPartitions.size();
-                log.warn("{} partitions have leader brokers without a matching listener, including {}",
-                        count, missingListenerPartitions.subList(0, Math.min(10, count)));
+                if (count == 1) {

Review comment:
       I think your example will be right if I fix it like below:
   
   ```diff
       String logStatement = "{} partition" + 
               (count > 1 ? "s have leader brokers" : " has a leader broker") +
               " without a matching listener, " +
   -            (count > 1 ? "which is " : "including ") + "{}";
   +            (count > 1 ? "including " : "which is ") + "{}";
   
       log.warn(logStatement,
               count, missingListenerPartitions.subList(0, Math.min(10, count)));
   ```
   
   Thank you for your suggestion. :D




-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org