adixitconfluent commented on code in PR #19757:
URL: https://github.com/apache/kafka/pull/19757#discussion_r2100482477


##########
core/src/main/java/kafka/server/share/DelayedShareFetch.java:
##########
@@ -904,4 +948,30 @@ private boolean forceCompleteRequest() {
         }
         return completedByMe;
     }
+
+    private void completeRemoteShareFetchRequestOutsidePurgatory() {
+        try {
+            if (outsidePurgatoryCallbackLock.compareAndSet(false, true)) {
+                completeRemoteStorageShareFetchRequest();
+            }
+        } finally {
+            outsidePurgatoryCallbackLock.set(false);
+        }

Review Comment:
   you're right, since we only want one out of the 2 threads to execute 
`completeRemoteShareFetchRequestOutsidePurgatory`, its better to keep it 
locked. I have removed it.



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