m1a2st commented on code in PR #19862:
URL: https://github.com/apache/kafka/pull/19862#discussion_r2116055162


##########
core/src/main/java/kafka/server/share/DelayedShareFetch.java:
##########
@@ -379,7 +380,12 @@ public boolean tryComplete() {
                 partitionsAcquired.clear();
                 localPartitionsAlreadyFetched.clear();
             }
-            return forceComplete();
+            if (isCompleted()) {
+                return false;
+            } else {
+                forceComplete();
+                return true;
+            }

Review Comment:
   If `forceComplete()` is called inside a try-catch block, we need to 
determine whether an exception was thrown during the call.
   To avoid relying on the return value, we should use `isCompleted()` to check 
the completion state instead.



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