without looking at the actual code I would say the if(doPauseWaitQueue) should be while(doPauseWaitQueue)?
On Tue, Jul 26, 2011 at 9:07 AM, Uwe Schindler <[email protected]> wrote: > We still have a deadlock! I killed the 3.x build few minutes ago. > > ----- > Uwe Schindler > H.-H.-Meier-Allee 63, D-28213 Bremen > http://www.thetaphi.de > eMail: [email protected] > > >> -----Original Message----- >> From: [email protected] [mailto:[email protected]] >> Sent: Monday, July 25, 2011 3:09 PM >> To: [email protected] >> Subject: svn commit: r1150683 - in /lucene/dev/branches/branch_3x/lucene: >> CHANGES.txt src/java/org/apache/lucene/index/DocumentsWriter.java >> >> Author: mikemccand >> Date: Mon Jul 25 13:09:28 2011 >> New Revision: 1150683 >> >> URL: http://svn.apache.org/viewvc?rev=1150683&view=rev >> Log: >> LUCENE-3339: fix deadlock case when multiple threads add/update doc >> blocks >> >> Modified: >> lucene/dev/branches/branch_3x/lucene/CHANGES.txt >> >> lucene/dev/branches/branch_3x/lucene/src/java/org/apache/lucene/index >> /DocumentsWriter.java >> >> Modified: lucene/dev/branches/branch_3x/lucene/CHANGES.txt >> URL: >> http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/CHA >> NGES.txt?rev=1150683&r1=1150682&r2=1150683&view=diff >> ========================================================== >> ==================== >> --- lucene/dev/branches/branch_3x/lucene/CHANGES.txt (original) >> +++ lucene/dev/branches/branch_3x/lucene/CHANGES.txt Mon Jul 25 >> 13:09:28 2011 >> @@ -26,6 +26,10 @@ Bug fixes >> suppressed exceptions in the original exception, so stack trace >> will contain them. (Uwe Schindler) >> >> +* LUCENE-3339: Fixed deadlock case when multiple threads use the new >> + block-add (IndexWriter.add/updateDocuments) methods. (Robert Muir, >> + Mike McCandless) >> + >> New Features >> >> * LUCENE-3290: Added FieldInvertState.numUniqueTerms >> >> Modified: >> lucene/dev/branches/branch_3x/lucene/src/java/org/apache/lucene/index >> /DocumentsWriter.java >> URL: >> http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/ >> java/org/apache/lucene/index/DocumentsWriter.java?rev=1150683&r1=115 >> 0682&r2=1150683&view=diff >> ========================================================== >> ==================== >> --- >> lucene/dev/branches/branch_3x/lucene/src/java/org/apache/lucene/index >> /DocumentsWriter.java (original) >> +++ >> lucene/dev/branches/branch_3x/lucene/src/java/org/apache/lucene/index >> /DocumentsWriter.java Mon Jul 25 13:09:28 2011 >> @@ -843,6 +843,12 @@ final class DocumentsWriter { >> final int startDocID = docState.docID; >> int docID = startDocID; >> >> + // We must delay pausing until the full doc block is >> + // added, else we can hit deadlock if more than one >> + // thread is adding a block and we need to pause when >> + // both are only part way done: >> + boolean doPauseWaitQueue = false; >> + >> //System.out.println(Thread.currentThread().getName() + ": A " + >> docCount); >> for(Document doc : docs) { >> docState.doc = doc; >> @@ -873,13 +879,10 @@ final class DocumentsWriter { >> assert perDoc == null || perDoc.docID == docState.docID; >> final boolean doPause; >> if (perDoc != null) { >> - doPause = waitQueue.add(perDoc); >> + doPauseWaitQueue |= waitQueue.add(perDoc); >> } else { >> skipDocWriter.docID = docState.docID; >> - doPause = waitQueue.add(skipDocWriter); >> - } >> - if (doPause) { >> - waitForWaitQueue(); >> + doPauseWaitQueue |= waitQueue.add(skipDocWriter); >> } >> } >> >> @@ -937,6 +940,10 @@ final class DocumentsWriter { >> } >> } >> } >> + >> + if (doPauseWaitQueue) { >> + waitForWaitQueue(); >> + } >> } >> //System.out.println(Thread.currentThread().getName() + ": A " + >> docCount); >> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
