You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "shizhenzhen (Jira)" <ji...@apache.org> on 2022/10/21 03:32:00 UTC

[jira] [Created] (KAFKA-14328) KafkaAdminClient should be Changing the exception level When an exception occurs

shizhenzhen created KAFKA-14328:
-----------------------------------

             Summary: KafkaAdminClient should be Changing the exception level When an exception occurs
                 Key: KAFKA-14328
                 URL: https://issues.apache.org/jira/browse/KAFKA-14328
             Project: Kafka
          Issue Type: Improvement
          Components: admin
    Affects Versions: 3.3
            Reporter: shizhenzhen
         Attachments: image-2022-10-21-11-19-21-064.png

 

 

KafkaAdminClient 的一些日志全部是 log.trace.  当遇到异常的时候根本不知道什么原因,导致排查问题非常艰难。

 

就比如下面这里,当去请求Metadata请求的时候,如果查询到的Topic有分区Leader=-1的时候,就会抛出异常;

 

但是这个时候实际上异常是被吞掉了的,这里往上面抛出异常之后,到了下面第二张图的 Catch部分。

他会把这个请求重新放到到请求队列中。然后就会陷入无限读重试之后,直到达到超时时间抛出异常:Timed out waiting for a node assignment. Call: metadata

 

无法给Metadata请求分配节点,正常情况下谁知道他真正的异常其实是

 

```

org.apache.kafka.common.errors.LeaderNotAvailableException: There is no leader for this topic-partition as we are in the middle of a leadership election.

 

```

 

 

 

 

!https://user-images.githubusercontent.com/10442648/196944422-e11b732f-6f7f-4f77-8d9c-1f0544257461.png!

 

 

 

下面截图那里是我改成的warn基本的日志

!image-2022-10-21-11-19-21-064.png!

 

 

 

 

所以我希望这里的log.trace 能改成 log.warn ; 给一个提醒。

就可以说明当前因为某个异常的原因而导致可能的重试。

 

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)