ellaeln commented on code in PR #2607:
URL: https://github.com/apache/solr/pull/2607#discussion_r1698263165


##########
solr/core/src/java/org/apache/solr/core/SyntheticSolrCore.java:
##########
@@ -72,4 +88,43 @@ protected RestManager initRestManager() throws SolrException 
{
     // We do not expect RestManager ops on Coordinator Nodes
     return new RestManager();
   }
+
+  @Override
+  public SolrCore reload(ConfigSet coreConfig) throws IOException {
+    // only one reload at a time
+    synchronized (getUpdateHandler().getSolrCoreState().getReloadLock()) {
+      solrCoreState.increfSolrCoreState();
+      boolean success = false;
+      SyntheticSolrCore newCore = null;
+      try {
+        CoreDescriptor newCoreDescriptor = new CoreDescriptor(getName(), 
getCoreDescriptor());
+        newCoreDescriptor.loadExtraProperties(); // Reload the extra properties
+
+        newCore =
+            new SyntheticSolrCore(
+                getCoreContainer(),
+                newCoreDescriptor,
+                coreConfig,
+                getDataDir(),
+                getUpdateHandler(),
+                getDeletionPolicy(),
+                this,
+                true);
+
+        newCore.getSearcher(true, false, null, true);
+        success = true;
+        return newCore;
+      } finally {
+        // close the new core on any errors that have occurred.
+        if (!success && newCore != null && newCore.getOpenCount() > 0) {

Review Comment:
   This is a bit weird because the act of returning the new core causes the 
newCoreCount to be bigger than 0 and triggers the close. Maybe it's better to 
switch them directly instead of returning and jumping back to close?



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