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 8D1699B34 for ; Thu, 1 Mar 2012 22:29:55 +0000 (UTC) Received: (qmail 73920 invoked by uid 500); 1 Mar 2012 22:29:54 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 73858 invoked by uid 500); 1 Mar 2012 22:29:54 -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 73851 invoked by uid 99); 1 Mar 2012 22:29:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Mar 2012 22:29:54 +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 [74.125.82.48] (HELO mail-ww0-f48.google.com) (74.125.82.48) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Mar 2012 22:29:46 +0000 Received: by wgbdq10 with SMTP id dq10so656753wgb.5 for ; Thu, 01 Mar 2012 14:29:26 -0800 (PST) Received-SPF: pass (google.com: domain of lucene@mikemccandless.com designates 10.180.95.105 as permitted sender) client-ip=10.180.95.105; Authentication-Results: mr.google.com; spf=pass (google.com: domain of lucene@mikemccandless.com designates 10.180.95.105 as permitted sender) smtp.mail=lucene@mikemccandless.com Received: from mr.google.com ([10.180.95.105]) by 10.180.95.105 with SMTP id dj9mr14782595wib.18.1330640966320 (num_hops = 1); Thu, 01 Mar 2012 14:29:26 -0800 (PST) Received: by 10.180.95.105 with SMTP id dj9mr11865925wib.18.1330640966253; Thu, 01 Mar 2012 14:29:26 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.167.196 with HTTP; Thu, 1 Mar 2012 14:29:06 -0800 (PST) In-Reply-To: References: From: Michael McCandless Date: Thu, 1 Mar 2012 17:29:06 -0500 Message-ID: Subject: Re: toString on Thread To: dev@lucene.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQnQ9mImVXg0/lwMpdS1dXkDd4oQkpzUGfz7/uGn1xYj4akQnNo9mYzMFrfriFdVN0oynsiD X-Virus-Checked: Checked by ClamAV on apache.org Scary! I think remove it? Though it is nice to see what segments are being merged by the thread... but this risk is awful. App can turn on IW's infoStream to see it too... Mike McCandless http://blog.mikemccandless.com On Thu, Mar 1, 2012 at 5:20 PM, Dawid Weiss wrote: > Overriding toString on a Thread is not a good idea. Can I remove it or > at least make it simpler in ConcurrentMergeScheduler? This override > caused a fantastic deadlock -- an interesting possibility I didn't > think of -- again, when dumping threads (for the exception string) > Thread.toString was invoked from what I thought was an isolated > monitor (and it was); only toString had its own monitors underneath > and here's what happened (simplified): > > "Lucene Merge Thread #1": > =A0 =A0 =A0 =A0at org.apache.lucene.index.IndexWriter.segString(IndexWrit= er.java:3764) > =A0 =A0 =A0 =A0- waiting to lock (a org.apache.lucene.index.IndexWri= ter) > =A0 =A0 =A0 =A0at org.apache.lucene.index.ConcurrentMergeScheduler$MergeT= hread.toString(ConcurrentMergeScheduler.java:499) > =A0 =A0 =A0 =A0... > =A0 =A0 =A0 =A0at org.apache.lucene.util.LuceneTestCase.getRandom(LuceneT= estCase.java:276) > =A0 =A0 =A0 =A0at org.apache.lucene.index.TestTransactions.access$100(Tes= tTransactions.java:33) > =A0 =A0 =A0 =A0at org.apache.lucene.index.TestTransactions$RandomFailure.= eval(TestTransactions.java:40) > =A0 =A0 =A0 =A0at org.apache.lucene.store.MockDirectoryWrapper.maybeThrow= DeterministicException(MockDirectoryWrapper.java:688) > =A0 =A0 =A0 =A0- locked (a org.apache.lucene.store.MockDirectoryWrap= per) > =A0 =A0 =A0 =A0at org.apache.lucene.store.MockDirectoryWrapper.createOutp= ut(MockDirectoryWrapper.java:415) > =A0 =A0 =A0 =A0- locked (a org.apache.lucene.store.MockDirectoryWrap= per) > =A0 =A0 =A0 =A0at org.apache.lucene.codecs.lucene40.Lucene40FieldInfosWri= ter.write(Lucene40FieldInfosWriter.java:56) > =A0 =A0 =A0 =A0at org.apache.lucene.index.SegmentMerger.mergeFieldInfos(S= egmentMerger.java:194) > =A0 =A0 =A0 =A0at org.apache.lucene.index.SegmentMerger.merge(SegmentMerg= er.java:109) > =A0 =A0 =A0 =A0at org.apache.lucene.index.IndexWriter.mergeMiddle(IndexWr= iter.java:3623) > =A0 =A0 =A0 =A0at org.apache.lucene.index.IndexWriter.merge(IndexWriter.j= ava:3257) > =A0 =A0 =A0 =A0at org.apache.lucene.index.ConcurrentMergeScheduler.doMerg= e(ConcurrentMergeScheduler.java:382) > =A0 =A0 =A0 =A0at org.apache.lucene.index.ConcurrentMergeScheduler$MergeT= hread.run(ConcurrentMergeScheduler.java:451) > "Lucene Merge Thread #0": > =A0 =A0 =A0 =A0at org.apache.lucene.store.MockDirectoryWrapper.listAll(Mo= ckDirectoryWrapper.java:695) > =A0 =A0 =A0 =A0- waiting to lock (a org.apache.lucene.store.MockDire= ctoryWrapper) > =A0 =A0 =A0 =A0at org.apache.lucene.index.IndexFileDeleter.refresh(IndexF= ileDeleter.java:345) > =A0 =A0 =A0 =A0at org.apache.lucene.index.IndexWriter.merge(IndexWriter.j= ava:3272) > =A0 =A0 =A0 =A0- locked (a org.apache.lucene.index.IndexWriter) > =A0 =A0 =A0 =A0at org.apache.lucene.index.ConcurrentMergeScheduler.doMerg= e(ConcurrentMergeScheduler.java:382) > =A0 =A0 =A0 =A0at org.apache.lucene.index.ConcurrentMergeScheduler$MergeT= hread.run(ConcurrentMergeScheduler.java:451) > > A classic, isn't it? > > Dawid > > --------------------------------------------------------------------- > 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