kirktrue commented on code in PR #16241:
URL: https://github.com/apache/kafka/pull/16241#discussion_r1634061316


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java:
##########
@@ -1132,12 +1133,26 @@ private CompletableFuture<Map<TopicPartition, 
OffsetAndMetadata>> addOffsetFetch
             Optional<OffsetFetchRequestState> inflight =
                     inflightOffsetFetches.stream().filter(r -> 
r.sameRequest(request)).findAny();
 
-            if (dupe.isPresent() || inflight.isPresent()) {
+            if (dupe.isPresent()) {
                 log.debug("Duplicated unsent offset fetch request found for 
partitions: {}", request.requestedPartitions);
-                dupe.orElseGet(inflight::get).chainFuture(request.future);
+                dupe.get().chainFuture(request.future);
+            } else if (inflight.isPresent()) {

Review Comment:
   @AndrewJSchofield—I totally agree 😄
   
   The initial pass was my attempt to shoehorn in a fix while disturbing the 
surrounding code as little as possible. I wanted to keep things as localized as 
possible, given the deadline.
   
   I am working on an approach that is hopefully more sane.



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