Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
-
New
Description
Spinoff from LUCENE-6745 suggested by rcmuir.
It's dangerous today that Directory.openInput returns an IndexInput which you can then use for IO but also clone so other threads can do thread-private IO.
We could instead make this strongly typed, e.g. Directory.openInput returns a thingy (Handle, Descriptor, something) whose sole purpose is to 1) produce IndexInput for thread-private use, and 2) close.
In the meantime, we could add some simple asserts to MDW to detect if the "original" IndexInput is ever use for anything but cloning, when other threads have cloned / do clone in the future. I'll explore that first ... it's a start.