uschindler commented on PR #12705:
URL: https://github.com/apache/lucene/pull/12705#issuecomment-1774105554

   > > If that's the case, it seems fine, although a bit fragile to maintain?
   > 
   > I argued during the long journey of Panama Foreign to have a specific 
subclass of IllegalStateException for the case of unmapping a MemorySegment 
from another thread. It is too late. You could look into exception message but 
that's even more fragile due to localization.
   
   I think in contrast to the signalling NPE, the IllegalStateException is not 
hurting if it appears as cause of the AlreadyClosedException. The error message 
also tells you that the segment was closed by another thread, which might be 
helpful. I will think about it and possibly make a new PR that improves this 
for MemorySegmentIndexInput. 
   
   I can also figure out if there is a check for MemorySegments if they are 
unreachable. I think they added something in recent versions. It may not work 
in Java 19, but later ones can be improved.
   
   Uwe


-- 
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: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to