frankvicky commented on PR #16833: URL: https://github.com/apache/kafka/pull/16833#issuecomment-2293387098
Hi @lianetm, I've reviewed the code provided by you and @chia7712, and I noticed that there are three key points in the codebase where timeout handling occurs: - `failAndRemoveExpiredFetchRequests()` (expiring requests when collecting them): https://github.com/apache/kafka/blob/8cfd6312644260717d67fd4dd87dc6794fde52bb/clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java#L1228-L1231 - `trySend()`(expiring requests right before sending): https://github.com/apache/kafka/blob/8cfd6312644260717d67fd4dd87dc6794fde52bb/clients/src/main/java/org/apache/kafka/clients/consumer/internals/NetworkClientDelegate.java#L171-L179 - `handleTimedOutRequests()` (expiring requests if inflight request times out): https://github.com/apache/kafka/blob/8cfd6312644260717d67fd4dd87dc6794fde52bb/clients/src/main/java/org/apache/kafka/clients/NetworkClient.java#L866-L874 These methods are invoked at different points during the poll process, indicating that they each serve a unique purpose. However, I've noticed that the timing of `trySend()` handling expired requests is quite close to when `failAndRemoveExpiredFetchRequests()` is called. This overlap might suggest some redundancy. Last but the least, if our goal is to align with the behavior of the `ClassicKafkaConsumer`, removing `failAndRemoveExpiredFetchRequests()` could simplify the process without losing the intended functionality. WYDT ? -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org