Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-6757

Directory.openInput should not directly return IndexInput

    XMLWordPrintableJSON

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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            mikemccand Michael McCandless
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: