You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/01/11 10:26:25 UTC

[GitHub] [kafka] dajac commented on a change in pull request #11566: KAFKA-13495: add reason to JoinGroupRequest

dajac commented on a change in pull request #11566:
URL: https://github.com/apache/kafka/pull/11566#discussion_r781968801



##########
File path: core/src/main/scala/kafka/server/KafkaApis.scala
##########
@@ -1690,6 +1690,7 @@ class KafkaApis(val requestChannel: RequestChannel,
         joinGroupRequest.data.protocolType,
         protocols,
         sendResponseCallback,
+        Option(joinGroupRequest.data.reason()),

Review comment:
       nit: You can remove the parenthesis after `reason`.

##########
File path: clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java
##########
@@ -467,6 +468,7 @@ boolean joinGroupIfNeeded(final Timer timer) {
                 final RuntimeException exception = future.exception();
 
                 resetJoinGroupFuture();
+                rejoinReason = "rebalance failed due to '" + exception.getMessage() + "' (" + exception.getClass().getSimpleName() + ")";

Review comment:
       Also, it might be better to use `synchronized (AbstractCoordinator.this) { }` to mutate both `rejoinReason` and `rejoinNeeded` in order to ensure that they are consistent with each others.

##########
File path: clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java
##########
@@ -467,6 +468,7 @@ boolean joinGroupIfNeeded(final Timer timer) {
                 final RuntimeException exception = future.exception();
 
                 resetJoinGroupFuture();
+                rejoinReason = "rebalance failed due to '" + exception.getMessage() + "' (" + exception.getClass().getSimpleName() + ")";

Review comment:
       nit: Would it make sense to use `String.format` like we did at L460?




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