apoorvmittal10 commented on code in PR #17583:
URL: https://github.com/apache/kafka/pull/17583#discussion_r1817768353
##########
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:
Yeah, you are right. As the request is already completed then it should
return false as other thread should have already bumped the `completed` count.
And it should be removed from iteration once watched sees it completed. I made
the change.
--
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]