LUCENE-1135: fix rare deadlock case in testAddIndexOnDiskFull

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@696005 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2008-09-16 18:49:16 +00:00
parent b88b6a73ad
commit 088a42b846
1 changed files with 8 additions and 0 deletions

View File

@ -4584,6 +4584,14 @@ public class IndexWriter {
synchronized(this) {
// sizeInBytes > 0 means this is an autoCommit at
// the end of a merge. If at this point stopMerges
// is true (which means a rollback() or
// rollbackTransaction() is waiting for us to
// finish), we skip the commit to avoid deadlock
if (sizeInBytes > 0 && stopMerges)
return;
// Wait for any running addIndexes to complete
// first, then block any from running until we've
// copied the segmentInfos we intend to sync: