philipnee commented on code in PR #14406:
URL: https://github.com/apache/kafka/pull/14406#discussion_r1340690791


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/Fetcher.java:
##########
@@ -106,7 +127,62 @@ public void onFailure(RuntimeException e) {
         return fetchRequestMap.size();
     }
 
+    protected void maybeCloseFetchSessions(final Timer timer) {
+        final List<RequestFuture<ClientResponse>> requestFutures = new 
ArrayList<>();
+        Map<Node, FetchSessionHandler.FetchRequestData> fetchRequestMap = 
prepareCloseFetchSessionRequests();
+
+        for (Map.Entry<Node, FetchSessionHandler.FetchRequestData> entry : 
fetchRequestMap.entrySet()) {
+            final Node fetchTarget = entry.getKey();
+            final FetchSessionHandler.FetchRequestData data = entry.getValue();
+            final FetchRequest.Builder request = 
createFetchRequest(fetchTarget, data);
+            final RequestFuture<ClientResponse> responseFuture = 
client.send(fetchTarget, request);

Review Comment:
   since we also need to send offsetCommit upon closing, maybe it is best to 
poll the networkClientDelegate upon closing. 



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

Reply via email to