SOLR-1595: make rollback set isClosed

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@883518 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2009-11-23 22:10:41 +00:00
parent 548f973766
commit 22ce12d324
2 changed files with 16 additions and 1 deletions

View File

@ -82,6 +82,12 @@ Bug Fixes
matching. This change requires reindexing for any content with matching. This change requires reindexing for any content with
such characters. (Robert Muir, yonik) 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 Other Changes
---------------------- ----------------------

View File

@ -223,7 +223,7 @@ public class SolrIndexWriter extends IndexWriter {
* } * }
* **** * ****
*/ */
private boolean isClosed = false; private volatile boolean isClosed = false;
public void close() throws IOException { public void close() throws IOException {
log.debug("Closing Writer " + name); log.debug("Closing Writer " + name);
try { try {
@ -236,6 +236,15 @@ public class SolrIndexWriter extends IndexWriter {
} }
} }
@Override
public void rollback() throws IOException {
try {
super.rollback();
} finally {
isClosed = true;
}
}
@Override @Override
protected void finalize() throws Throwable { protected void finalize() throws Throwable {
try { try {