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

Closing the DirTaxonomyReader while another thread access the cache can throw NPE

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 9.0
    • None
    • modules/facet
    • None
    • New

    Description

      When we close a DirectoryTaxonomyReader in doClose, we set the categoryCache to null. But if a thread is next after this doClose call, it will still try to acquire a lock and synchronize on it. This will result in an NPE.

      This works well today, because we operate on the assumption that the user will always call doClose after all threads have completed.
      One suggestion by mikemccand in this PR was to make categoryCache final and throw an AlreadyClosedException.

      Attachments

        Activity

          People

            Unassigned Unassigned
            gworah Gautam Worah
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: