apoorvmittal10 commented on PR #19759:
URL: https://github.com/apache/kafka/pull/19759#issuecomment-2893719889

   > > The onComplete method in DelayedOperation is guaranteed to run only
   > > once, either by tryComplete or onExpiration.
   > 
   > `onExpiration`? or `forceComplete`?
   > 
   > > if
   > > onComplete is already invoked by another thread then execution of
   > > tryComplete is not required.
   > 
   > Excuse me, how to address it? do you plan to check `isCompleted` before 
executing `tryComplete`?
   
   For 1) I meant the invocation by run method, I have updated the description. 
Thanks.
   
   For 2) tryComplete invocation is in `lock` itself and there is also a checck 
for `isCompleted` prior invocation: 
https://github.com/apache/kafka/blob/d3f897948630d6f387969cdc9542fcabb6f1d2a9/server-common/src/main/java/org/apache/kafka/server/purgatory/DelayedOperation.java#L136
   
   @chia7712 just rewriting, so we have corrected flow of comments.


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