frankvicky commented on PR #16833:
URL: https://github.com/apache/kafka/pull/16833#issuecomment-2282803051

   Hello @lianetm 
   I had a question while tracing the code.
   In L1194~L1205 
https://github.com/apache/kafka/blob/49fc14f6116a697550339a8804177bd9290d15db/clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java#L1194-L1205
   
   The `failAndRemoveExpiredFetchRequests` method at L1198 clears expired fetch 
requests from `unsentOffsetFetches`. However, the `partitionedBySendability` 
collection at L1194 is created using `unsentOffsetFetches`, and its result does 
not change due to the check performed at L1198. So even if an expired fetch 
request is removed in `failAndRemoveExpiredFetchRequests`, as long as the fetch 
request was `canSendRequest` when `partitionedBySendability` was created, it 
will still be added to `unsentRequests` and eventually included in the 
`PollResult` .
   This seems not reasonable, as expired fetch requests should not be sent 
again.
   
   I’m not sure if I missed something or if this behavior isn’t what we 
expected. 🤔 
   


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