mirror of https://github.com/apache/lucene.git
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:
parent
e25e019c1d
commit
7a5097d8f6
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue