SOLR-6002: CLOSE_LOCK does not need to be static, waitForMerges when DirectUpdateHandler2 closes the IndexWriter, add Greg to CHANGES entry.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1589327 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2014-04-23 01:01:45 +00:00
parent 678758ae57
commit b74b88a823
3 changed files with 9 additions and 3 deletions

View File

@ -119,7 +119,7 @@ Bug Fixes
* SOLR-6002: Fix a couple of ugly issues around SolrIndexWriter close and
rollback as well as how SolrIndexWriter manages it's ref counted directory
instance. (Mark Miller)
instance. (Mark Miller, Gregory Chanan)
Other Changes
---------------------

View File

@ -786,7 +786,13 @@ public class DirectUpdateHandler2 extends UpdateHandler implements SolrCoreState
}
}
if (writer != null) writer.close();
if (writer != null) {
try {
writer.waitForMerges();
} finally {
writer.close();
}
}
} finally {
solrCoreState.getCommitLock().unlock();

View File

@ -49,7 +49,7 @@ public class SolrIndexWriter extends IndexWriter {
* System.currentTimeMillis() when commit was called. */
public static final String COMMIT_TIME_MSEC_KEY = "commitTimeMSec";
private static final Object CLOSE_LOCK = new Object();
private final Object CLOSE_LOCK = new Object();
String name;
private DirectoryFactory directoryFactory;