You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by jo...@apache.org on 2024/07/10 16:48:00 UTC

(kafka) branch trunk updated: MINOR: Log client idle disconnect events at DEBUG level (#16089)

This is an automated email from the ASF dual-hosted git repository.

jolshan pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 406d4c5ef97 MINOR: Log client idle disconnect events at DEBUG level (#16089)
406d4c5ef97 is described below

commit 406d4c5ef9710d55063e83512ee6a7046a3110c3
Author: NICOLAS GUYOMAR <ni...@gmail.com>
AuthorDate: Wed Jul 10 18:47:54 2024 +0200

    MINOR: Log client idle disconnect events at DEBUG level (#16089)
    
    We recently increased that log verbosity from INFO to DEBUG, but this is causing some confusion among users when an idle connection is disconnected, which is a normal activity. This makes it clear that the connection being disconnect has expired
    
    Reviewers: Dimitar Dimitrov <dd...@confluent.io>, Justine Olshan <jo...@confluent.io>
---
 .../src/main/java/org/apache/kafka/clients/NetworkClient.java    | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/clients/src/main/java/org/apache/kafka/clients/NetworkClient.java b/clients/src/main/java/org/apache/kafka/clients/NetworkClient.java
index 3e30cbd6cd0..4f0b3d11d79 100644
--- a/clients/src/main/java/org/apache/kafka/clients/NetworkClient.java
+++ b/clients/src/main/java/org/apache/kafka/clients/NetworkClient.java
@@ -1014,8 +1014,13 @@ public class NetworkClient implements KafkaClient {
     private void handleDisconnections(List<ClientResponse> responses, long now) {
         for (Map.Entry<String, ChannelState> entry : this.selector.disconnected().entrySet()) {
             String node = entry.getKey();
-            log.info("Node {} disconnected.", node);
-            processDisconnection(responses, node, now, entry.getValue());
+            ChannelState channelState = entry.getValue();
+            if (channelState == ChannelState.EXPIRED) {
+                log.debug("Idle connection to node {} disconnected.", node);
+            } else {
+                log.info("Node {} disconnected.", node);
+            }
+            processDisconnection(responses, node, now, channelState);
         }
     }