try / catch around pre and post close listeners

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1423918 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2012-12-19 16:19:37 +00:00
parent e25e019c1d
commit 7a5097d8f6
1 changed files with 10 additions and 2 deletions

View File

@ -176,7 +176,11 @@ public abstract class CachingDirectoryFactory extends DirectoryFactory {
List<CloseListener> listeners = closeListeners.remove(cacheValue.directory);
if (listeners != null) {
for (CloseListener listener : listeners) {
listener.preClose();
try {
listener.preClose();
} catch (Throwable t) {
SolrException.log(log, "Error executing preClose for directory", t);
}
}
}
try {
@ -188,7 +192,11 @@ public abstract class CachingDirectoryFactory extends DirectoryFactory {
if (listeners != null) {
for (CloseListener listener : listeners) {
listener.postClose();
try {
listener.postClose();
} catch (Throwable t) {
SolrException.log(log, "Error executing postClose for directory", t);
}
}
}
}