Return-Path: X-Original-To: apmail-lucene-dev-archive@www.apache.org Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E06AA7ED6 for ; Tue, 26 Jul 2011 11:06:20 +0000 (UTC) Received: (qmail 29255 invoked by uid 500); 26 Jul 2011 11:06:19 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 28919 invoked by uid 500); 26 Jul 2011 11:06:15 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 28909 invoked by uid 99); 26 Jul 2011 11:06:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Jul 2011 11:06:13 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.212.48] (HELO mail-vw0-f48.google.com) (209.85.212.48) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Jul 2011 11:06:06 +0000 Received: by vws7 with SMTP id 7so305714vws.35 for ; Tue, 26 Jul 2011 04:05:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.68.209 with SMTP id y17mr5737983vdt.294.1311678345137; Tue, 26 Jul 2011 04:05:45 -0700 (PDT) Received: by 10.52.158.66 with HTTP; Tue, 26 Jul 2011 04:05:45 -0700 (PDT) In-Reply-To: <003401cc4b62$b17d9f60$1478de20$@thetaphi.de> References: <20110725130930.CAB69238885D@eris.apache.org> <003401cc4b62$b17d9f60$1478de20$@thetaphi.de> Date: Tue, 26 Jul 2011 07:05:45 -0400 Message-ID: Subject: Re: svn commit: r1150683 - in /lucene/dev/branches/branch_3x/lucene: CHANGES.txt src/java/org/apache/lucene/index/DocumentsWriter.java From: Michael McCandless To: dev@lucene.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Ugh, I'll dig. Uwe was it hung on TestNRTThreads again? And the stack dump looked the same as LUCENE-3339? Mike McCandless http://blog.mikemccandless.com On Tue, Jul 26, 2011 at 3:07 AM, Uwe Schindler 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: uwe@thetaphi.de > > >> -----Original Message----- >> From: mikemccand@apache.org [mailto:mikemccand@apache.org] >> Sent: Monday, July 25, 2011 3:09 PM >> To: commits@lucene.apache.org >> 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=3D1150683&view=3Drev >> Log: >> LUCENE-3339: fix deadlock case when multiple threads add/update doc >> blocks >> >> Modified: >> =A0 =A0 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=3D1150683&r1=3D1150682&r2=3D1150683&view=3Ddiff >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- 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 >> =A0 =A0suppressed exceptions in the original exception, so stack trace >> =A0 =A0will contain them. =A0(Uwe Schindler) >> >> +* LUCENE-3339: Fixed deadlock case when multiple threads use the new >> + =A0block-add (IndexWriter.add/updateDocuments) methods. =A0(Robert Mui= r, >> + =A0Mike McCandless) >> + >> =A0New Features >> >> =A0* 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=3D1150683&r1=3D115 >> 0682&r2=3D1150683&view=3Ddiff >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- >> 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 { >> =A0 =A0 =A0final int startDocID =3D docState.docID; >> =A0 =A0 =A0int docID =3D startDocID; >> >> + =A0 =A0// We must delay pausing until the full doc block is >> + =A0 =A0// added, else we can hit deadlock if more than one >> + =A0 =A0// thread is adding a block and we need to pause when >> + =A0 =A0// both are only part way done: >> + =A0 =A0boolean doPauseWaitQueue =3D false; >> + >> =A0 =A0 =A0//System.out.println(Thread.currentThread().getName() + ": A = " + >> docCount); >> =A0 =A0 =A0for(Document doc : docs) { >> =A0 =A0 =A0 =A0docState.doc =3D doc; >> @@ -873,13 +879,10 @@ final class DocumentsWriter { >> =A0 =A0 =A0 =A0 =A0 =A0assert perDoc =3D=3D null || perDoc.docID =3D=3D = docState.docID; >> =A0 =A0 =A0 =A0 =A0 =A0final boolean doPause; >> =A0 =A0 =A0 =A0 =A0 =A0if (perDoc !=3D null) { >> - =A0 =A0 =A0 =A0 =A0 =A0doPause =3D waitQueue.add(perDoc); >> + =A0 =A0 =A0 =A0 =A0 =A0doPauseWaitQueue |=3D waitQueue.add(perDoc); >> =A0 =A0 =A0 =A0 =A0 =A0} else { >> =A0 =A0 =A0 =A0 =A0 =A0 =A0skipDocWriter.docID =3D docState.docID; >> - =A0 =A0 =A0 =A0 =A0 =A0doPause =3D waitQueue.add(skipDocWriter); >> - =A0 =A0 =A0 =A0 =A0} >> - =A0 =A0 =A0 =A0 =A0if (doPause) { >> - =A0 =A0 =A0 =A0 =A0 =A0waitForWaitQueue(); >> + =A0 =A0 =A0 =A0 =A0 =A0doPauseWaitQueue |=3D waitQueue.add(skipDocWrit= er); >> =A0 =A0 =A0 =A0 =A0 =A0} >> =A0 =A0 =A0 =A0 =A0} >> >> @@ -937,6 +940,10 @@ final class DocumentsWriter { >> =A0 =A0 =A0 =A0 =A0 =A0} >> =A0 =A0 =A0 =A0 =A0} >> =A0 =A0 =A0 =A0} >> + >> + =A0 =A0 =A0if (doPauseWaitQueue) { >> + =A0 =A0 =A0 =A0waitForWaitQueue(); >> + =A0 =A0 =A0} >> =A0 =A0 =A0} >> =A0 =A0 =A0//System.out.println(Thread.currentThread().getName() + ": = =A0 A " + >> docCount); >> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org > For additional commands, e-mail: dev-help@lucene.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org