Browse Source

MINOR: improve info log for memberIDRequired exception (#14192)

Currently, when consumer startup, there will be a log message said:

[2023-08-11 15:47:17,713] INFO [Consumer clientId=console-consumer, groupId=console-consumer-28605] Request joining group due to: rebalance failed due to 'The group member needs to have a valid member id before actually entering a consumer group.' (MemberIdRequiredException) (org.apache.kafka.clients.consumer.internals.ConsumerCoordinator)

It confused users and make them think there's something wrong in the consumer application. Since we already log need to re-join with the given member-id logs in the joinGroupResponseHandler and already requestRejoined. So, we can skip this confusion logs.

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>, Paolo Patierno <ppatiern@redhat.com>, vamossagar12 <sagarmeansocean@gmail.com>, David Jacot <djacot@confluent.io>
pull/14443/merge
Luke Chen 1 year ago committed by GitHub
parent
commit
bbcf40ad0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java

5
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java

@ -511,7 +511,10 @@ public abstract class AbstractCoordinator implements Closeable { @@ -511,7 +511,10 @@ public abstract class AbstractCoordinator implements Closeable {
final String fullReason = String.format("rebalance failed due to '%s' (%s)",
exception.getMessage(),
simpleName);
requestRejoin(shortReason, fullReason);
// Don't need to request rejoin again for MemberIdRequiredException since we've done that in JoinGroupResponseHandler
if (!(exception instanceof MemberIdRequiredException)) {
requestRejoin(shortReason, fullReason);
}
}
if (exception instanceof UnknownMemberIdException ||

Loading…
Cancel
Save