From 22ce12d324265081f230e9b61076b83dc0315347 Mon Sep 17 00:00:00 2001 From: Yonik Seeley Date: Mon, 23 Nov 2009 22:10:41 +0000 Subject: [PATCH] SOLR-1595: make rollback set isClosed git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@883518 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 6 ++++++ src/java/org/apache/solr/update/SolrIndexWriter.java | 11 ++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 31a85085b68..b2406151354 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -82,6 +82,12 @@ Bug Fixes matching. This change requires reindexing for any content with such 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.java index 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; + } + } + @Override protected void finalize() throws Throwable { try {