mirror of https://github.com/apache/lucene.git
LUCENE-4638, SOLR-3180: revert for now (try using the IW's writeLock to unlock)
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1425574 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
dfb17d3cdc
commit
1652b2649f
|
@ -224,7 +224,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {
|
|||
private Map<SegmentInfoPerCommit,Boolean> segmentsToMerge = new HashMap<SegmentInfoPerCommit,Boolean>();
|
||||
private int mergeMaxNumSegments;
|
||||
|
||||
protected Lock writeLock;
|
||||
private Lock writeLock;
|
||||
|
||||
private volatile boolean closed;
|
||||
private volatile boolean closing;
|
||||
|
|
|
@ -150,17 +150,11 @@ public class SolrIndexWriter extends IndexWriter {
|
|||
log.error("Error closing IndexWriter, trying rollback", t);
|
||||
super.rollback();
|
||||
}
|
||||
if (writeLock != null && writeLock.isLocked()) {
|
||||
if (IndexWriter.isLocked(directory)) {
|
||||
try {
|
||||
// we go right to the lock because
|
||||
// IndexWriter#unlock(Directory) does
|
||||
// not work well in this case with
|
||||
// native locks
|
||||
writeLock.release();
|
||||
IndexWriter.unlock(directory);
|
||||
} catch (Throwable t) {
|
||||
log.error(
|
||||
"Coud not unlock directory after seemingly failed IndexWriter#close()",
|
||||
t);
|
||||
log.error("Coud not unlock directory after seemingly failed IndexWriter#close()", t);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue