slachiewicz opened a new pull request, #837:
URL: https://github.com/apache/maven-indexer/pull/837

   A searcher that is never released, for example an `IteratorSearchResponse` 
the caller does not close, keeps its reader open, so 
`closeIndexingContext(context, true)` deletes index files that stay open in the 
JVM. This is the path reproduced in #702.
   
   `DefaultIndexingContext` now counts the searchers it hands out. 
`close(true)` releases the ones still held before it deletes the files, and 
logs a warning. `close(false)` leaves them usable until they are released.
   
   Two behavior changes to weigh:
   
   - After `close(true)`, a searcher or result set that is still in use fails 
with `AlreadyClosedException`. On Unix it used to keep reading the deleted 
files.
   - Releasing a searcher after its context was closed used to throw a 
`NullPointerException` and leave the reader open; it now releases the reader. 
Releasing a searcher the context did not hand out is a no-op.
   
   `purge()` and `replace()` are unchanged.
   
   ---
   
   To make clear that you license your contribution under
   the [Apache License Version 2.0, January 
2004](https://www.apache.org/licenses/LICENSE-2.0)
   check one of the following:
   
   - [ ] I hereby declare this contribution to be licensed under the [Apache 
License Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0)
   - [x] I hereby declare that I have filed an [Apache Individual Contributor 
License Agreement](https://www.apache.org/licenses/icla.pdf).
   


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