junrao commented on PR #19961:
URL: https://github.com/apache/kafka/pull/19961#issuecomment-3025572465

   @Forest0923 : Thanks for the analysis. I was able to reproduce this issue 
too. It seems that mmap is temporarily set to null by `resize()` through 
`onBecomeInactiveSegment()` when the segment rolls. I am not sure why 
`lookup()` will see the null mmap since there is protection through the 
read/write lock in `resize()` and `lookup()`. `closeHandler()` can permanently 
set mmap to null. I added some instrumentation. It seems that it's never called 
when the test fails. So, I am still puzzled on what's causing this.
   
   Also, why would adding `inRemapWriteLockThrows` in `truncateToEntries()` fix 
the issue?


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