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

SpellChecker file descriptor leak - no way to close the IndexSearcher used by SpellChecker internally

Details

    • New, Patch Available

    Description

      I can't find any way to close the IndexSearcher (and IndexReader) that
      is being used by SpellChecker internally.

      I've worked around this issue by keeping a single SpellChecker open
      for each index, but I'd really like to be able to close it and
      reopen it on demand without leaking file descriptors.

      Could we add a close() method to SpellChecker that will close the
      IndexSearcher and null the reference to it? And perhaps add some code
      that reopens the searcher if the reference to it is null? Or would
      that break thread safety of SpellChecker?

      The attached patch adds a close method but leaves it to the user to
      call setSpellIndex to reopen the searcher if desired.

      Attachments

        1. LUCENE-2108_Lucene_2_9_branch.patch
          28 kB
          Simon Willnauer
        2. LUCENE-2108_test_java14.patch
          3 kB
          Simon Willnauer
        3. LUCENE-2108.patch
          26 kB
          Simon Willnauer
        4. LUCENE-2108.patch
          23 kB
          Simon Willnauer
        5. LUCENE-2108.patch
          25 kB
          Simon Willnauer
        6. LUCENE-2108.patch
          4 kB
          Simon Willnauer
        7. LUCENE-2108-SpellChecker-close.patch
          0.6 kB
          Eirik Bjorsnos

        Issue Links

          Activity

            People

              simonw Simon Willnauer
              eirbjo Eirik Bjorsnos
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: