Skip to content

Apache Lucene open-source search software

catch throwable for tests (assert fails) - not just exception

Mark Robert Milleref16608cb17c
diff --git a/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java b/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java
index 9debe5cdeda..c5b7bfde377 100644
--- a/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java
+++ b/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java
@@ -94,15 +94,15 @@ public final class DefaultSolrCoreState extends SolrCoreState {
} catch (InterruptedException e) {}
}
- if (indexWriter != null) {
- try {
- indexWriter.close();
- } catch (Exception e) {
- SolrException.log(log, "Error closing old IndexWriter", e);
- }
- }
-
try {
+ if (indexWriter != null) {
+ try {
+ indexWriter.close();
+ } catch (Throwable t) {
+ SolrException.log(log, "Error closing old IndexWriter", t);
+ }
+ }
+
indexWriter = createMainIndexWriter(core, "DirectUpdateHandler2", false,
true);
// we need to null this so it picks up the new writer next get call