dsmiley commented on a change in pull request #580:
URL: https://github.com/apache/solr/pull/580#discussion_r797963815



##########
File path: 
solr/core/src/java/org/apache/solr/core/TransientSolrCoreCacheDefault.java
##########
@@ -89,6 +86,25 @@ public TransientSolrCoreCacheDefault(CoreContainer 
coreContainer) {
     transientDescriptors = new LinkedHashMap<>(initialCapacity);
   }
 
+  private void onEvict(SolrCore core) {
+    if (coreContainer.hasPendingCoreOps(core.getName())) {
+      if (log.isInfoEnabled()) {
+        log.info("NOT evicting transient core [{}]; it's loading or something 
else", core.getName());
+      }
+      transientCores.put(core.getName(), core); // put back
+    } else if (core.getOpenCount() > 1) {
+      if (log.isInfoEnabled()) {
+        log.info("NOT evicting transient core [{}]; it's still in use", 
core.getName());
+      }
+      transientCores.put(core.getName(), core); // put back
+    } else {
+      if (log.isInfoEnabled()) {
+        log.info("Closing transient core [{}] evicted from the cache", 
core.getName());
+      }
+      coreContainer.queueCoreToClose(core);

Review comment:
       This happens under a synchronized lock on SolrCores.modifyLock.  Also, 
pendingCloses is sort of a peer to pendingCoreOps, thus a pending close blocks 
any opening of this core.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to