Lucene - Core
  1. Lucene - Core
  2. LUCENE-3776

NRTManager shouldn't expose its private SearcherManager


    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6, 4.0-ALPHA
    • Component/s: None
    • Labels:
    • Lucene Fields:


      Spinoff from LUCENE-3769.

      To actually obtain an IndexSearcher from NRTManager, it's a 2-step process now.

      You must .getSearcherManager(), then .acquire() from the returned SearcherManager.

      This is very trappy... because if the app incorrectly calls maybeReopen on that private SearcherManager (instead of NRTManager.maybeReopen) then it can unexpectedly cause threads to block forever, waiting for the necessary gen to become visible. This will be hard to debug... I don't like creating trappy APIs.

      Hopefully once LUCENE-3761 is in, we can fix NRTManager to no longer expose its private SM, instead subclassing ReferenceManaager.

      Or alternatively, or in addition, maybe we factor out a new interface (SearcherProvider or something...) that only has acquire and release methods, and both NRTManager and ReferenceManager/SM impl that, and we keep NRTManager's SM private.

      1. LUCENE-3776.patch
        18 kB
        Michael McCandless
      2. LUCENE-3776.patch
        20 kB
        Michael McCandless
      3. LUCENE-3776.patch
        25 kB
        Michael McCandless


        Michael McCandless created issue -
        Michael McCandless made changes -
        Field Original Value New Value
        Assignee Michael McCandless [ mikemccand ]
        Michael McCandless made changes -
        Attachment LUCENE-3776.patch [ 12514797 ]
        Michael McCandless made changes -
        Attachment LUCENE-3776.patch [ 12514860 ]
        Michael McCandless made changes -
        Attachment LUCENE-3776.patch [ 12514985 ]
        Michael McCandless made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Uwe Schindler made changes -
        Status Resolved [ 5 ] Closed [ 6 ]


          • Assignee:
            Michael McCandless
            Michael McCandless
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: