[
https://issues.apache.org/jira/browse/KAFKA-14328?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Luke Chen reassigned KAFKA-14328:
---------------------------------
Assignee: shizhenzhen
> 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
> Assignee: shizhenzhen
> Priority: Major
> Attachments: image-2022-10-21-11-19-21-064.png,
> image-2022-10-21-14-56-31-753.png, image-2022-10-21-16-54-40-588.png,
> image-2022-10-21-16-56-45-448.png, image-2022-10-21-16-58-19-353.png,
> image-2022-10-24-14-28-10-365.png, image-2022-10-24-14-47-30-641.png,
> image-2022-10-24-14-48-27-907.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 ; 给一个提醒。
> 就可以说明当前因为某个异常的原因而导致可能的重试。
>
>
> ----
>
>
> !image-2022-10-21-14-56-31-753.png!
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)