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

   After some discussion with @mcimadamore we figured out that there are more 
problem, so we need to rely on the exception message.
   
   The following problem can occur and possibly happens here: When you close 
the main IndexInput from another thread this may fail with an 
IllegalStateException. While trying to do this also the clone may get the above 
ISE and *should* convert it to the AlreadyClosedException. But when the main 
thread got the ISE the close operation did not work and the previous state is 
restored. And that's waht we see here. The main thread in the test tries to 
close but gets an exception so the close did not succeed. 
   
   The main problem that the clsoed state is a 3state setting: OPEN, CLOSING, 
CLOSED. When the scope is in CLOSING state it may go back to OPEN. So after the 
IllegalStateException the status may go back to "OPEN" and this is why the 
Exception is not converted.
   
   I will add another improvement to the test to "retry" closing on ISE. We 
should maybe also add a loop in the MemorySegmentIndexInput that it tries to 
close multiple times while yielding the threads.


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to