frankvicky commented on code in PR #17614:
URL: https://github.com/apache/kafka/pull/17614#discussion_r1944925198
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java:
##########
@@ -1187,6 +1183,21 @@ public synchronized RequestFuture<Void>
maybeLeaveGroup(String leaveReason) {
return future;
}
+ private boolean
shouldSendLeaveGroupRequest(CloseOptions.GroupMembershipOperation
membershipOperation) {
+ if (CloseOptions.GroupMembershipOperation.REMAIN_IN_GROUP ==
membershipOperation) {
+ return false;
+ } else if (CloseOptions.GroupMembershipOperation.LEAVE_GROUP ==
membershipOperation) {
+ // According to KIP-1092, static members can leave the group if
the consumer group membership operation is LEAVE_GROUP.
+ return true;
Review Comment:
Hi @ableegoldman,
Thanks for the review.
Currently, if the coordinator is unknown on close, either a classic consumer
or async consumer would keep trying to find an available coordinator until
timeout. IMHO, the logic here is to try their best to send a leave request.
Given that, I intend to keep the current logic.
https://github.com/apache/kafka/blob/aa8c57665f8e1f220dfc6fe2f67fc2b56af8a1ee/clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java#L318
https://github.com/apache/kafka/blob/aa8c57665f8e1f220dfc6fe2f67fc2b56af8a1ee/clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java#L464-L472
cc @chia7712, @lianetm @kirktrue
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]