dajac commented on code in PR #12388:
URL: https://github.com/apache/kafka/pull/12388#discussion_r916573678
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java:
##########
@@ -1112,9 +1121,10 @@ public synchronized RequestFuture<Void>
maybeLeaveGroup(String leaveReason) {
// attempt any resending if the request fails or times out.
log.info("Member {} sending LeaveGroup request to coordinator {}
due to {}",
generation.memberId, coordinator, leaveReason);
+ final String reason = truncateIfRequired(leaveReason);
LeaveGroupRequest.Builder request = new LeaveGroupRequest.Builder(
rebalanceConfig.groupId,
- Collections.singletonList(new
MemberIdentity().setMemberId(generation.memberId).setReason(leaveReason))
+ Collections.singletonList(new
MemberIdentity().setMemberId(generation.memberId).setReason(reason))
Review Comment:
You can actually do the following in your test:
```
// force a rebalance
expectJoinGroup(memberId, "Manual test trigger", generation,
memberId);
expectSyncGroup(generation, memberId);
coordinator.requestRejoin("Manual test trigger");
ensureActiveGroup(generation, memberId);
assertEquals("", coordinator.rejoinReason());
```
`expectJoinGroup` verifies the request sent out.
--
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]