Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use java.lang.ref.Cleaner to close cloned IndexInputs (#6351)
As detailed [in this issue][1], Lucene does not close the cloned IndexInput instances, so we are using the Cleaner mechanism from the JDK to close any unclosed clones. A single static Cleaner instance to ensure any unclosed clone of an IndexInput is closed. This instance creates a single daemon thread on which it performs the cleaning actions. For an already-closed IndexInput, the cleaning action is a no-op. For an open IndexInput, the close action will decrement a reference count. [1]: #5243 (comment) Signed-off-by: Andrew Ross <[email protected]>
- Loading branch information