You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "dhruvildave235 (via GitHub)" <gi...@apache.org> on 2025/12/29 10:02:35 UTC

[PR] KAFKA-XXXXX: Improve consumer rebalance warning log with exception stack trace [kafka]

dhruvildave235 opened a new pull request, #21219:
URL: https://github.com/apache/kafka/pull/21219

   ### 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
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-XXXXX: Improve consumer rebalance warning log with exception stack trace [kafka]

Posted by "dhruvildave235 (via GitHub)" <gi...@apache.org>.
dhruvildave235 commented on PR #21219:
URL: https://github.com/apache/kafka/pull/21219#issuecomment-3696048410

   Thanks for the review!  
   The change is ready and CI has been validated locally.  
   Happy to address any feedback.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-XXXXX: Improve consumer rebalance warning log with exception stack trace [kafka]

Posted by "mjsax (via GitHub)" <gi...@apache.org>.
mjsax closed pull request #21219: KAFKA-XXXXX: Improve consumer rebalance warning log with exception stack trace
URL: https://github.com/apache/kafka/pull/21219


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-XXXXX: Improve consumer rebalance warning log with exception stack trace [kafka]

Posted by "dhruvildave235 (via GitHub)" <gi...@apache.org>.
dhruvildave235 commented on PR #21219:
URL: https://github.com/apache/kafka/pull/21219#issuecomment-3696150499

   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.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-XXXXX: Improve consumer rebalance warning log with exception stack trace [kafka]

Posted by "mjsax (via GitHub)" <gi...@apache.org>.
mjsax commented on PR #21219:
URL: https://github.com/apache/kafka/pull/21219#issuecomment-3837435358

   Seems to be AI generated... The error message is international as-is; no need to include the stack trace. Closing this PR.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-XXXXX: Improve consumer rebalance warning log with exception stack trace [kafka]

Posted by "dhruvildave235 (via GitHub)" <gi...@apache.org>.
dhruvildave235 commented on PR #21219:
URL: https://github.com/apache/kafka/pull/21219#issuecomment-3753296712

   Hi maintainers 👋  
   Just a gentle follow-up on this PR.
   
   All CI checks have passed and the PR has CI approval.
   Please let me know if any further review or changes are needed from my side.
   
   Thanks!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-XXXXX: Improve consumer rebalance warning log with exception stack trace [kafka]

Posted by "dhruvildave235 (via GitHub)" <gi...@apache.org>.
dhruvildave235 commented on PR #21219:
URL: https://github.com/apache/kafka/pull/21219#issuecomment-3712805884

   Hi maintainers, just a gentle ping on this PR.
   All CI checks have passed and the PR has CI approval.
   Please let me know if any further changes are needed from my side.
   Thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-XXXXX: Improve consumer rebalance warning log with exception stack trace [kafka]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #21219:
URL: https://github.com/apache/kafka/pull/21219#discussion_r2650633389


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerMembershipManager.java:
##########
@@ -478,13 +478,13 @@ public void consumerRebalanceListenerCallbackCompleted(ConsumerRebalanceListener
         Optional<KafkaException> error = event.error();
         CompletableFuture<Void> future = event.future();
 
-        if (error.isPresent()) {
-            Exception e = error.get();
-            log.warn(
-                    "The {} method completed with an error ({}); signaling to continue to the next phase of rebalance",
+            if (error.isPresent()) {

Review Comment:
   The if statement has incorrect indentation. It should be indented with 8 spaces to align with the rest of the method body, not 12 spaces.



##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerMembershipManager.java:
##########
@@ -478,13 +478,13 @@ public void consumerRebalanceListenerCallbackCompleted(ConsumerRebalanceListener
         Optional<KafkaException> error = event.error();
         CompletableFuture<Void> future = event.future();
 
-        if (error.isPresent()) {
-            Exception e = error.get();
-            log.warn(
-                    "The {} method completed with an error ({}); signaling to continue to the next phase of rebalance",
+            if (error.isPresent()) {
+                Exception e = error.get();
+                log.warn(
+                    "Rebalance step failed in method={}, proceeding to next phase",
                     methodName.fullyQualifiedMethodName(),
-                    e.getMessage()
-            );
+                    e
+                );
 
             future.completeExceptionally(e);

Review Comment:
   The indentation of this line is inconsistent. It appears to have 13 spaces of indentation when it should have 12 spaces to align with the other statements in the if block.



##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerMembershipManager.java:
##########
@@ -478,13 +478,13 @@ public void consumerRebalanceListenerCallbackCompleted(ConsumerRebalanceListener
         Optional<KafkaException> error = event.error();
         CompletableFuture<Void> future = event.future();
 
-        if (error.isPresent()) {
-            Exception e = error.get();
-            log.warn(
-                    "The {} method completed with an error ({}); signaling to continue to the next phase of rebalance",
+            if (error.isPresent()) {
+                Exception e = error.get();
+                log.warn(
+                    "Rebalance step failed in method={}, proceeding to next phase",

Review Comment:
   The log message uses a named parameter style 'method={}' which is inconsistent with the logging style used throughout this file and the codebase. All other log statements use positional placeholders without names, e.g., 'The {} method...' (see line 463, 491-492). The log message should follow the same pattern as the debug statement in the else branch for consistency.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org