-
Notifications
You must be signed in to change notification settings - Fork 14.9k
KAFKA-XXXXX: Improve consumer rebalance warning log with exception stack trace #21219
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
base: trunk
Are you sure you want to change the base?
KAFKA-XXXXX: Improve consumer rebalance warning log with exception stack trace #21219
Conversation
|
Thanks for the review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR improves observability in consumer rebalance error handling by logging the full exception object instead of just the exception message. This enables stack traces to be captured in logs, making it easier to diagnose rebalance-related issues in production environments.
Key changes:
- Modified the
log.warn()call inConsumerMembershipManager.consumerRebalanceListenerCallbackCompleted()to pass the exception object as the last parameter instead ofe.getMessage() - Updated the log message text from a more verbose description to a more concise format
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...nts/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerMembershipManager.java
Outdated
Show resolved
Hide resolved
...nts/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerMembershipManager.java
Show resolved
Hide resolved
...nts/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerMembershipManager.java
Outdated
Show resolved
Hide resolved
|
Thanks for the review. I’ve fixed the indentation and updated the log message to follow Kafka’s positional placeholder style. The exception object is now passed to preserve stack traces. Please let me know if anything else is needed. |
|
Hi maintainers, just a gentle ping on this PR. |
What changed
Improved the consumer rebalance warning log by logging the full exception object instead of only the message.
Why
This improves observability and makes it easier to diagnose rebalance-related issues in production environments.
Testing
./gradlew :clients:compileJava