title: Solr: unload core wait forever after cores swap
body: <p>I have created a Solr CoreAdminHandler extension with the goal to swap two cores and remove the old one.</p>
  
  <p>My code looks like this:</p>
  
  <pre><code>SolrCore core = coreContainer.create("newcore", coreProps)
  coreContainer.swap("newcore", "livecore")
  // the old livecore is now newcore, so unload it and remove all the related dirs
  coreContainer.unload("newcore", true, true, true)
  </code></pre>
  
  <p>After the last statement get executed the Solr log starts printing the following messages forever</p>
  
  <blockquote>
    <p>61424 INFO  (pool-1-thread-1) [   x:newcore] o.a.s.c.SolrCore
    Core newcore is not yet closed, waiting 100 ms before checking
    again.</p>
  </blockquote>
  
  <p>I tried to call the close() method on the SolrCore instance before and after the unload but the result is the same.</p>
  
  <p>Any idea? Can this be a Solr bug?</p>
  
  <p>EDIT
  I have created an issue in Solr jira for this:
  <a href="https://issues.apache.org/jira/browse/SOLR-8757" rel="nofollow">https://issues.apache.org/jira/browse/SOLR-8757</a></p>