dsmiley commented on code in PR #4764:
URL: https://github.com/apache/solr/pull/4764#discussion_r3821910518


##########
solr/core/src/java/org/apache/solr/core/SolrCores.java:
##########
@@ -142,20 +142,6 @@ public SolrCore putCore(CoreDescriptor cd, SolrCore core) {
     }
   }
 
-  /**
-   * @return A list of "permanent" cores, i.e. cores that may not be swapped 
out and are currently
-   *     loaded.
-   *     <p>A core may be non-transient but still lazily loaded. If it is 
"permanent" and lazy-load
-   *     _and_ not yet loaded it will _not_ be returned by this call.
-   *     <p>This list is a new copy, it can be modified by the caller (e.g. it 
can be sorted).
-   */
-  @Deprecated

Review Comment:
   I think either we bring this back, or we add the method I suggested to 
CoreContainer `forEachLoadedCore(Consumer<SolrCore>))`



##########
solr/core/src/java/org/apache/solr/core/CoreContainer.java:
##########
@@ -1382,13 +1382,12 @@ public void shutdown() {
   }
 
   public void cancelCoreRecoveries() {
-
-    List<SolrCore> cores = solrCores.getCores();
-
     // we must cancel without holding the cores sync
     // make sure we wait for any recoveries to stop
-    for (SolrCore core : cores) {
-      try {
+    for (String coreName : solrCores.getLoadedCoreNames()) {
+      // getCoreFromAnyList, not getCore: never loads, safe during shutdown
+      try (SolrCore core = solrCores.getCoreFromAnyList(coreName, true)) {

Review Comment:
   Okay I misunderstood your other PR comments where I *thought* you/AI 
communicated solrCores.getCoreFromAnyList doesn't incref which is why you were 
using it.  Now I actually looked at our code to confirm.



##########
solr/core/src/test/org/apache/solr/core/TestCoreContainer.java:
##########


Review Comment:
   very thorough of your LLM to do this on the account of my inquiry but we can 
lose this



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to