squah-confluent commented on code in PR #23174:
URL: https://github.com/apache/kafka/pull/23174#discussion_r3845565525
##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/classic/ClassicGroupMember.java:
##########
@@ -397,16 +398,35 @@ public void setAssignment(byte[] value) {
}
/**
+ * Set the member's join future. If a join future is already pending when
a new,
+ * non-null one is set, the new request supersedes it, so the earlier one
is
+ * completed with REBALANCE_IN_PROGRESS first -- otherwise it would never
resolve
+ * on its own.
Review Comment:
Trying to de-Claude the writing:
```suggestion
* Set the member's join future. Replaces any pre-existing join future
and completes it with
* REBALANCE_IN_PROGRESS.
```
(same for `setAwaitingSyncFuture`)
##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/classic/ClassicGroupMember.java:
##########
@@ -397,16 +398,35 @@ public void setAssignment(byte[] value) {
}
/**
+ * Set the member's join future. If a join future is already pending when
a new,
+ * non-null one is set, the new request supersedes it, so the earlier one
is
+ * completed with REBALANCE_IN_PROGRESS first -- otherwise it would never
resolve
+ * on its own.
+ *
* @param value the updated join future.
*/
public void setAwaitingJoinFuture(CompletableFuture<JoinGroupResponseData>
value) {
+ if (value != null && awaitingJoinFuture != null) {
Review Comment:
There are two paths where we call `setAwaitingJoin/SyncFuture(null)`:
```java
class ClassicGroup {
public boolean completeJoinFuture(
ClassicGroupMember member,
JoinGroupResponseData response
) {
...
member.awaitingJoinFuture().complete(response);
member.setAwaitingJoinFuture(null);
...
}
// and the same for completeSyncFuture
}
```
I think we should declare `ClassicMember.completeJoin/SyncFuture` to
complete-and-clear instead of carving out special handling of `null` here.
--
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]