Log root cause error when directories can't be deleted on core unload

This commit is contained in:
Alan Woodward 2016-11-18 13:45:29 +00:00
parent fb14ed82f8
commit 7ca0ba043a
1 changed files with 2 additions and 4 deletions

View File

@ -2627,16 +2627,14 @@ public final class SolrCore implements SolrInfoMBean, Closeable {
try {
FileUtils.deleteDirectory(dataDir);
} catch (IOException e) {
SolrException.log(log, "Failed to delete data dir for unloaded core:" + cd.getName()
+ " dir:" + dataDir.getAbsolutePath());
log.error("Failed to delete data dir for unloaded core: {} dir: {}", cd.getName(), dataDir.getAbsolutePath(), e);
}
}
if (deleteInstanceDir) {
try {
FileUtils.deleteDirectory(cd.getInstanceDir().toFile());
} catch (IOException e) {
SolrException.log(log, "Failed to delete instance dir for unloaded core:" + cd.getName()
+ " dir:" + cd.getInstanceDir());
log.error("Failed to delete instance dir for unloaded core: {} dir: {}", cd.getName(), cd.getInstanceDir(), e);
}
}
}