Solr
  1. Solr
  2. SOLR-4005

If CoreContainer fails to register a created core, it should close it.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.1, 6.0
    • Component/s: None
    • Labels:
      None

      Activity

      Hide
      Mark Miller added a comment -

      Simple change:

      lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/CoreContainer.java (original)
      +++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/CoreContainer.java Mon Oct 29 16:10:39 2012
      @@ -482,6 +482,7 @@ public class CoreContainer 
      
          for (int i=0; i<nodes.getLength(); i++) {
            Node node = nodes.item(i);
      +      SolrCore core = null;
            try {
              String rawName = DOMUtil.getAttr(node, CORE_NAME, null);
              if (null == rawName) {
      @@ -526,7 +527,7 @@ public class CoreContainer 
      
              p.setCoreProperties(readProperties(cfg, node));
      
      -        SolrCore core = create(p);
      +        core  = create(p);
              register(name, core, false);
      
              // track original names
      @@ -534,6 +535,9 @@ public class CoreContainer 
            }
            catch (Throwable ex) {
              SolrException.log(log,null,ex);
      +        if (core != null) {
      +          core.close();
      +        }
            }
          }
        }
      Show
      Mark Miller added a comment - Simple change: lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/CoreContainer.java (original) +++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/CoreContainer.java Mon Oct 29 16:10:39 2012 @@ -482,6 +482,7 @@ public class CoreContainer for (int i=0; i<nodes.getLength(); i++) { Node node = nodes.item(i); + SolrCore core = null; try { String rawName = DOMUtil.getAttr(node, CORE_NAME, null); if (null == rawName) { @@ -526,7 +527,7 @@ public class CoreContainer p.setCoreProperties(readProperties(cfg, node)); - SolrCore core = create(p); + core = create(p); register(name, core, false); // track original names @@ -534,6 +535,9 @@ public class CoreContainer } catch (Throwable ex) { SolrException.log(log,null,ex); + if (core != null) { + core.close(); + } } } }
      Hide
      Commit Tag Bot added a comment -

      [branch_4x commit] Mark Robert Miller
      http://svn.apache.org/viewvc?view=revision&revision=1403397

      SOLR-4005: If CoreContainer fails to register a created core, it should close it.

      Show
      Commit Tag Bot added a comment - [branch_4x commit] Mark Robert Miller http://svn.apache.org/viewvc?view=revision&revision=1403397 SOLR-4005 : If CoreContainer fails to register a created core, it should close it.
      Hide
      Commit Tag Bot added a comment -

      [branch_4x commit] Mark Robert Miller
      http://svn.apache.org/viewvc?view=revision&revision=1403397

      SOLR-4005: If CoreContainer fails to register a created core, it should close it.

      Show
      Commit Tag Bot added a comment - [branch_4x commit] Mark Robert Miller http://svn.apache.org/viewvc?view=revision&revision=1403397 SOLR-4005 : If CoreContainer fails to register a created core, it should close it.

        People

        • Assignee:
          Mark Miller
          Reporter:
          Mark Miller
        • Votes:
          0 Vote for this issue
          Watchers:
          2 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved:

            Development