This is an automated email from the ASF dual-hosted git repository.
showuon pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/trunk by this push:
new bbcf40ad0dc MINOR: improve info log for memberIDRequired exception
(#14192)
bbcf40ad0dc is described below
commit bbcf40ad0dc7739d803244bbbfbaa4598850344b
Author: Luke Chen <[email protected]>
AuthorDate: Fri Sep 29 14:47:19 2023 +0800
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 <[email protected]>, Paolo Patierno
<[email protected]>, vamossagar12 <[email protected]>, David Jacot
<[email protected]>
---
.../apache/kafka/clients/consumer/internals/AbstractCoordinator.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git
a/clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java
b/clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java
index bb3c6b93030..24d05e7d63b 100644
---
a/clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java
+++
b/clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java
@@ -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 ||