mirror of https://github.com/apache/lucene.git
SOLR-8246: fix SolrCLI to delete config directory if creating a core failed
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1714764 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
830fc1fbfb
commit
64783d1757
|
@ -522,6 +522,9 @@ Other Changes
|
||||||
|
|
||||||
* SOLR-8269: Upgrade commons-collections to 3.2.2. This fixes a known serialization vulnerability (janhoy)
|
* SOLR-8269: Upgrade commons-collections to 3.2.2. This fixes a known serialization vulnerability (janhoy)
|
||||||
|
|
||||||
|
* SOLR-8246: Fix SolrCLI to clean the config directory in case creating a core failed.
|
||||||
|
(Jason Gerlowski via Shai Erera)
|
||||||
|
|
||||||
================== 5.3.1 ==================
|
================== 5.3.1 ==================
|
||||||
|
|
||||||
Bug Fixes
|
Bug Fixes
|
||||||
|
|
|
@ -1573,7 +1573,7 @@ public class SolrCLI {
|
||||||
throw new IllegalArgumentException("\n"+configSetDir.getAbsolutePath()+" doesn't contain a conf subdirectory or solrconfig.xml\n");
|
throw new IllegalArgumentException("\n"+configSetDir.getAbsolutePath()+" doesn't contain a conf subdirectory or solrconfig.xml\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo("\nSetup new core instance directory:\n" + coreInstanceDir.getAbsolutePath());
|
echo("\nCopying configuration to new core instance directory:\n" + coreInstanceDir.getAbsolutePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
String createCoreUrl =
|
String createCoreUrl =
|
||||||
|
@ -1585,12 +1585,17 @@ public class SolrCLI {
|
||||||
|
|
||||||
echo("\nCreating new core '" + coreName + "' using command:\n" + createCoreUrl + "\n");
|
echo("\nCreating new core '" + coreName + "' using command:\n" + createCoreUrl + "\n");
|
||||||
|
|
||||||
|
try {
|
||||||
Map<String,Object> json = getJson(createCoreUrl);
|
Map<String,Object> json = getJson(createCoreUrl);
|
||||||
|
|
||||||
CharArr arr = new CharArr();
|
CharArr arr = new CharArr();
|
||||||
new JSONWriter(arr, 2).write(json);
|
new JSONWriter(arr, 2).write(json);
|
||||||
echo(arr.toString());
|
echo(arr.toString());
|
||||||
echo("\n");
|
echo("\n");
|
||||||
|
} catch (Exception e) {
|
||||||
|
/* create-core failed, cleanup the copied configset before propagating the error. */
|
||||||
|
FileUtils.deleteDirectory(coreInstanceDir);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} // end CreateCoreTool class
|
} // end CreateCoreTool class
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue