Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-597

Need to remove SolrCore "caching" from SolrServlet

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.3
    • 1.3
    • None
    • None

    Description

      As discussed in this thread...

      http://www.nabble.com/Add-SolrCore.getSolrCore%28%29-to-SolrServlet.doGet-to-work-arround-Resin-bug--to17501487.html#a17515374

      SolrServlet currently calls SolrCore.getSolrCore() during it's init method, and then caches that core for reuse on each requests.

      Now that we have multicore support, and the decision was made that the singleton accessor should always return the more recently created core, this behavior is inconsistent with SolrUpdateServlet which calls SolrCore.getSolrCore() on each request.

      One potential problem with this is that in a "mixed use" setup, where some requests are handled by the SolrDispatchFilter and some are handled by the SolrServlet you'll get insonstent results as cores are reloaded/renamed.

      Another problem that has been observed "in the wild" is that since some versions of Resin do not correctly load Filter's before Servlets, the SolrServlet is constructing a core that only it ever sees before the DispatchFilter has a chance to construct the "normal" core.

      The consensus solution is to make SolrServlet refetch the SolrCore singleton on each request – this means that heavily customized legacy setups that do not use the SolrDispatchFilter at all will not see initialization "lag" or errors until the first request. butthis seems acceptible given that SolrServlet is already deprecated - anyone using SolrServlet in a customized application who upgrades will want to start using the DispatchFilter anyway.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            hossman Chris M. Hostetter
            hossman Chris M. Hostetter
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment