bruno-roustant commented on a change in pull request #2066:
URL: https://github.com/apache/lucene-solr/pull/2066#discussion_r519225448



##########
File path: solr/core/src/java/org/apache/solr/core/SolrCores.java
##########
@@ -198,35 +188,91 @@ protected SolrCore putCore(CoreDescriptor cd, SolrCore 
core) {
    * 
    * Put another way, this will not return any names of cores that are lazily 
loaded but have not been called for yet
    * or are transient and either not loaded or have been swapped out.
-   * 
-   * @return List of currently loaded cores.
+   *
+   * @return A unsorted collection.
    */
-  Set<String> getLoadedCoreNames() {
-    Set<String> set;
-
+  Collection<String> getLoadedCoreNames() {
     synchronized (modifyLock) {
-      set = new TreeSet<>(cores.keySet());
-      if (getTransientCacheHandler() != null) {
-        set.addAll(getTransientCacheHandler().getLoadedCoreNames());
-      }
+      TransientSolrCoreCache transientCoreCache = getTransientCacheHandler();

Review comment:
       There is a comment in TransientSolrCoreCacheFactory.newInstance() line 
60 that says a bad config should not prevent the CoreContainer from loading. It 
logs an continues.
   Then SolrCores.getTransientCacheHandler() checks transientCoreCache null. If 
so it logs an error and returns null.
   
   Before this first PR I tried to replace the null by a NOOP 
TransientSolrCoreCache singleton. But I realize now that I could use an 
instance with the parent container. Let's do it, it'll save a lot of null 
checks.




----------------------------------------------------------------
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.

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



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

Reply via email to