AndrewJSchofield commented on code in PR #18063:
URL: https://github.com/apache/kafka/pull/18063#discussion_r1875029001


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumeRequestManager.java:
##########
@@ -990,16 +990,18 @@ UnsentRequest buildRequest() {
             }
 
             ShareAcknowledgeRequest.Builder requestBuilder = 
sessionHandler.newShareAcknowledgeBuilder(groupId, fetchConfig);

Review Comment:
   It seems to me that `ShareSessionHandler.addPartitionToFetch` saves 
partition and acknowledgement state into the handler to be built by the request 
builder. In the event that the request builder cannot be built, such as because 
a new share session needs to be created, the partition and acknowledgement 
state is still left in the share session. I worry that it is possible this 
could lead to an erroneous request in some situations when the session handler 
is used again when a new connection has been created. I think that it would be 
prudent to clear out `nextAcknowledgements` and `nextPartitions` in 
`ShareSessionHandler.newShareAcknowledgeBuilder` in the case where it returns 
null.



-- 
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]

Reply via email to