Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose AdminClient exception when failing to describe the cluster #2222

Merged
merged 1 commit into from
Jan 10, 2025

Conversation

harmadasg
Copy link
Contributor

If the AdminClient fails to describe the cluster, the exception is not exposed.

 2024-09-23 20:03:28,871 ERROR com.linkedin.kafka.cruisecontrol.KafkaCruiseControlMain: [main]: Uncaught exception on thread Thread[main,5,main]
java.lang.RuntimeException: Failed to describe Kafka cluster configs.
        at com.linkedin.kafka.cruisecontrol.config.KafkaAdminTopicConfigProvider.configure(KafkaAdminTopicConfigProvider.java:174) ~[cruise-control-2.5.116.jar:?]
        at com.linkedin.kafka.cruisecontrol.config.KafkaCruiseControlConfigUtils.getConfiguredInstance(KafkaCruiseControlConfigUtils.java:49) ~[cruise-control-2.5.116.jar:?]
        at com.linkedin.kafka.cruisecontrol.config.KafkaCruiseControlConfig.getConfiguredInstance(KafkaCruiseControlConfig.java:98) ~[cruise-control-2.5.116.jar:?]
        at com.linkedin.kafka.cruisecontrol.monitor.LoadMonitor.<init>(LoadMonitor.java:155) ~[cruise-control-2.5.116.jar:?]
        at com.linkedin.kafka.cruisecontrol.monitor.LoadMonitor.<init>(LoadMonitor.java:124) ~[cruise-control-2.5.116.jar:?]
        at com.linkedin.kafka.cruisecontrol.KafkaCruiseControl.<init>(KafkaCruiseControl.java:126) ~[cruise-control-2.5.116.jar:?]
        at com.linkedin.kafka.cruisecontrol.async.AsyncKafkaCruiseControl.<init>(AsyncKafkaCruiseControl.java:34) ~[cruise-control-2.5.116.jar:?]
        at com.linkedin.kafka.cruisecontrol.KafkaCruiseControlApp.<init>(KafkaCruiseControlApp.java:36) ~[cruise-control-2.5.116.jar:?]
        at com.linkedin.kafka.cruisecontrol.KafkaCruiseControlServletApp.<init>(KafkaCruiseControlServletApp.java:32) ~[cruise-control-2.5.116.jar:?]
        at com.linkedin.kafka.cruisecontrol.KafkaCruiseControlUtils.getCruiseControlApp(KafkaCruiseControlUtils.java:923) ~[cruise-control-2.5.116.jar:?]
        at com.linkedin.kafka.cruisecontrol.KafkaCruiseControlMain.main(KafkaCruiseControlMain.java:37) ~[cruise-control-2.5.116.jar:?]

The reason is that the exception generated by AdminClient is caught and a generic RuntimeException is thrown in KafkaAdminTopicConfigProvider but the original error trace is lost. This PR adds the original exception as the cause of the newly thrown RuntimeException. This change can improve troubleshooting and makes it much easier to figure out what went wrong with the DESCRIBE_CLUSTER API call.

@viktorsomogyi
Copy link
Contributor

@mhratson would you please review this small PR?

@harmadasg harmadasg closed this Jan 7, 2025
@harmadasg harmadasg deleted the expose_adminclient_exception branch January 7, 2025 10:43
@harmadasg harmadasg restored the expose_adminclient_exception branch January 7, 2025 11:19
@harmadasg harmadasg reopened this Jan 7, 2025
@efeg efeg merged commit 6b5fe9e into linkedin:main Jan 10, 2025
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants