junrao commented on code in PR #17583:
URL: https://github.com/apache/kafka/pull/17583#discussion_r1817435200


##########
core/src/main/scala/kafka/server/DelayedOperation.scala:
##########
@@ -119,7 +119,12 @@ abstract class DelayedOperation(delayMs: Long,
   /**
    * Thread-safe variant of tryComplete()
    */
-  private[server] def safeTryComplete(): Boolean = inLock(lock)(tryComplete())
+  private[server] def safeTryComplete(): Boolean = inLock(lock) {
+    if (isCompleted)
+      true

Review Comment:
   > If yes execute the completion logic by calling
   >  forceComplete() and return true iff forceComplete returns true; otherwise 
return false
   
   This is the return value definition. So if the request is completed, we 
should return `false`.



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