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

chia7712 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 525b278288a KAFKA-19117 Client Throttling Log messages should be of 
log level - WARN (Java client) (#19456)
525b278288a is described below

commit 525b278288acbf74de366284257789c300e9252f
Author: Siddhartha Devineni <[email protected]>
AuthorDate: Mon Jul 6 16:14:34 2026 +0200

    KAFKA-19117 Client Throttling Log messages should be of log level - WARN 
(Java client) (#19456)
    
    KAFKA-19117 Issue description:
    
    We experienced an outage in our application due to a built up Kafka lag,
    which we eventually discovered to be the problem with Kafka Clients
    being throttled.
    
    Even when using the confluent cluster, the dashboard does point to
    exceeding the quota of the principal.
    
    It will be nice, if the log message on the client side is a WARNING.
    This helps those who don't have visibility to cluster, and just look at
    the problem from the client side, setup alerts etc. (instead of enabling
    TRACE to figure out where the problem is)
    
    NetworkClient#maybeThrottle in the class NetworkClient:
    
    Changed from:   `log.trace("Connection to node {} is throttled for {} ms
    until timestamp {}", nodeId, throttleTimeMs, now + throttleTimeMs); `
    
     to
    
     `log.warn("Connection to node {} is throttled for {} ms until timestamp
    {}", nodeId, throttleTimeMs, now + throttleTimeMs);`
    
    Reviewers: Kirk True <[email protected]>, Chia-Ping Tsai
     <[email protected]>, PoAn Yang <[email protected]>
---
 clients/src/main/java/org/apache/kafka/clients/NetworkClient.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 fd45ff14a91..8a1e1965940 100644
--- a/clients/src/main/java/org/apache/kafka/clients/NetworkClient.java
+++ b/clients/src/main/java/org/apache/kafka/clients/NetworkClient.java
@@ -994,7 +994,7 @@ public class NetworkClient implements KafkaClient {
         if (throttleTimeMs > 0 && response.shouldClientThrottle(apiVersion)) {
             inFlightRequests.incrementThrottleTime(nodeId, throttleTimeMs);
             connectionStates.throttle(nodeId, now + throttleTimeMs);
-            log.trace("Connection to node {} is throttled for {} ms until 
timestamp {}", nodeId, throttleTimeMs,
+            log.warn("Connection to node {} is throttled for {} ms until 
timestamp {}", nodeId, throttleTimeMs,
                       now + throttleTimeMs);
         }
     }

Reply via email to