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

   > > Now the thread in tryComplete cannot invoke onComplete as completed is 
marked true in DelayedOperation, hence acquired partitions will be released.
   > 
   > Hmm, is this true? tryComplete will only release the acquired locks if 
forceComplete() returns true, right?
   
   Yes it's true, it can happen in current implementation. 
[This](https://github.com/apache/kafka/blob/e88c10d5952c464a0f597b295deaa51e4c9fa978/core/src/main/java/kafka/server/share/DelayedShareFetch.java#L902)
 line when invoked from tryComplete can release the locks, which is correct but 
conflicts with concurrent execution on request timeout. To make sure that our 
acquired share partitions release is correct, we added a check 
[here](https://github.com/apache/kafka/blob/e88c10d5952c464a0f597b295deaa51e4c9fa978/core/src/main/java/kafka/server/share/SharePartition.java#L1384).
 In our performance runs we saw the issue. However it will not cause issue per 
se for share fetches, as SharePartition will not acquire record offsets which 
are already acquired but it will have some wasted fetches.


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