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

SolrDispatchFilter CoreContainerProvider can hang on startup

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • None
    • None
    • None
    • None

    Description

      I've been stumped a number of times over the years looking at an unreproducible test failure that shows SolrDispatchFilter.init calling CoreContainerProvider.waitForReadyService and waiting on a CoundDownLatch indefinitely. Meanwhile, no other trace or problems in the logs. Eventually the test will timeout and we see a thread dump.

      I suspect a timing bug of exactly when GC happens interplaying with the use of WeakHashMap. In particular I see ContextInitializationKey's constructor publishing "this" to the ServletContext which seems like a bad place to put such logic (constructors publishing themselves is suspicious in general; avoid it). But the point is that it'll overwrite an existing entry in the context that may very well be there, thus suddenly making an existing entry in a WeakHashMap weakly reachable and it may be removed. There is too much complexity there; I think it should be overhauled a bit. I'm working on a PR.

      Attachments

        Issue Links

          Activity

            People

              dsmiley David Smiley
              dsmiley David Smiley
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: