Apache Lucene open-source search software
SOLR-1595: make rollback set isClosed
Yonik Seeley22ce12d32426
diff --git a/CHANGES.txt b/CHANGES.txtindex 31a85085b68..b2406151354 100644--- a/CHANGES.txt+++ b/CHANGES.txt@@ -82,6 +82,12 @@ Bug Fixesmatching. This change requires reindexing for any content withsuch characters. (Robert Muir, yonik)+* SOLR-1595: A rollback operation followed by the shutdown of Solr+ or the close of a core resulted in a warning:+ "SEVERE: SolrIndexWriter was not closed prior to finalize()" although+ there were no other consequences. (yonik)++Other Changes----------------------diff --git a/src/java/org/apache/solr/update/SolrIndexWriter.java b/src/java/org/apache/solr/update/SolrIndexWriter.javaindex f39eecf7c20..9758031b70f 100644--- a/src/java/org/apache/solr/update/SolrIndexWriter.java+++ b/src/java/org/apache/solr/update/SolrIndexWriter.java@@ -223,7 +223,7 @@ public class SolrIndexWriter extends IndexWriter {* }* *****/- private boolean isClosed = false;+ private volatile boolean isClosed = false;public void close() throws IOException {log.debug("Closing Writer " + name);try {@@ -236,6 +236,15 @@ public class SolrIndexWriter extends IndexWriter {}}+ @Override+ public void rollback() throws IOException {+ try {+ super.rollback();+ } finally {+ isClosed = true;+ }+ }+@Overrideprotected void finalize() throws Throwable {try {