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:
Mark Robert Miller 2012-12-24 02:10:25 +00:00
parent dfb17d3cdc
commit 1652b2649f
2 changed files with 4 additions and 10 deletions

View File

@ -224,7 +224,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {
private Map<SegmentInfoPerCommit,Boolean> segmentsToMerge = new HashMap<SegmentInfoPerCommit,Boolean>(); private Map<SegmentInfoPerCommit,Boolean> segmentsToMerge = new HashMap<SegmentInfoPerCommit,Boolean>();
private int mergeMaxNumSegments; private int mergeMaxNumSegments;
protected Lock writeLock; private Lock writeLock;
private volatile boolean closed; private volatile boolean closed;
private volatile boolean closing; private volatile boolean closing;

View File

@ -150,17 +150,11 @@ public class SolrIndexWriter extends IndexWriter {
log.error("Error closing IndexWriter, trying rollback", t); log.error("Error closing IndexWriter, trying rollback", t);
super.rollback(); super.rollback();
} }
if (writeLock != null && writeLock.isLocked()) { if (IndexWriter.isLocked(directory)) {
try { try {
// we go right to the lock because IndexWriter.unlock(directory);
// IndexWriter#unlock(Directory) does
// not work well in this case with
// native locks
writeLock.release();
} catch (Throwable t) { } catch (Throwable t) {
log.error( log.error("Coud not unlock directory after seemingly failed IndexWriter#close()", t);
"Coud not unlock directory after seemingly failed IndexWriter#close()",
t);
} }
} }
break; break;