Solr
  1. Solr
  2. SOLR-2179

unregistered searchers not closed

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.1, 4.0-ALPHA
    • Component/s: None
    • Labels:
      None

      Description

      A searcher that has not yet been registered is not tracked anywhere and may not be closed if the core is closed.

      1. SOLR-2179.patch
        2 kB
        Yonik Seeley

        Activity

        Grant Ingersoll made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Hide
        Grant Ingersoll added a comment -

        Bulk close for 3.1.0 release

        Show
        Grant Ingersoll added a comment - Bulk close for 3.1.0 release
        Yonik Seeley made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 3.1 [ 12314371 ]
        Fix Version/s 4.0 [ 12314992 ]
        Resolution Fixed [ 1 ]
        Hide
        Yonik Seeley added a comment -

        Committed.
        This doesn't really represent that serious of an issue - but it's nice to get it out of the way so that it doesn't mask more serious ones.

        With this patch, all of the remaining searcher leaks look to be taken care of.

        Show
        Yonik Seeley added a comment - Committed. This doesn't really represent that serious of an issue - but it's nice to get it out of the way so that it doesn't mask more serious ones. With this patch, all of the remaining searcher leaks look to be taken care of.
        Yonik Seeley made changes -
        Field Original Value New Value
        Attachment SOLR-2179.patch [ 12457624 ]
        Hide
        Yonik Seeley added a comment -

        Basically, the idea is to wait for the search executor to finish before closing the main searcher.

        Here's the patch:

        • closes the search executor before closing the last registered searcher
        • moves the close hook calls first, and catches any exceptions thrown by them

        New comments in the code explain a little more:

        +      // Since we waited for the searcherExecutor to shut down,
        +      // there should be no more searchers warming in the background
        +      // that we need to take care of.
        +      //
        +      // For the case that a searcher was registered *before* warming
        +      // then the searchExecutor will throw an exception when getSearcher()
        +      // tries to use it, and the exception handling code should close it.
        +      closeSearcher();
        
        Show
        Yonik Seeley added a comment - Basically, the idea is to wait for the search executor to finish before closing the main searcher. Here's the patch: closes the search executor before closing the last registered searcher moves the close hook calls first, and catches any exceptions thrown by them New comments in the code explain a little more: + // Since we waited for the searcherExecutor to shut down, + // there should be no more searchers warming in the background + // that we need to take care of. + // + // For the case that a searcher was registered *before* warming + // then the searchExecutor will throw an exception when getSearcher() + // tries to use it, and the exception handling code should close it. + closeSearcher();
        Hide
        Chris Male added a comment -

        Is the searcher registered pre or post warming?

        Show
        Chris Male added a comment - Is the searcher registered pre or post warming?
        Hide
        Yonik Seeley added a comment -

        I've been seeing some strange errors in the tests, and I noticed that it was all very short tests that didn't do any queries that were the problem.

        So the core starts up, asynchronously a searcher is created + warmed, and then the core is shut down before that searcher is even registered (or the core has a reference to it to close it).

        This doesn't seem particularly easy to solve, unless you completely synchronize the reader.reopen() + new searcher creation.

        Show
        Yonik Seeley added a comment - I've been seeing some strange errors in the tests, and I noticed that it was all very short tests that didn't do any queries that were the problem. So the core starts up, asynchronously a searcher is created + warmed, and then the core is shut down before that searcher is even registered (or the core has a reference to it to close it). This doesn't seem particularly easy to solve, unless you completely synchronize the reader.reopen() + new searcher creation.
        Yonik Seeley created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Yonik Seeley
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development