Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 96231 invoked from network); 28 Oct 2009 12:48:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 28 Oct 2009 12:48:26 -0000 Received: (qmail 59378 invoked by uid 500); 28 Oct 2009 12:48:25 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 59318 invoked by uid 500); 28 Oct 2009 12:48:25 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 59310 invoked by uid 99); 28 Oct 2009 12:48:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Oct 2009 12:48:25 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.211.183] (HELO mail-yw0-f183.google.com) (209.85.211.183) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Oct 2009 12:48:15 +0000 Received: by ywh13 with SMTP id 13so671733ywh.29 for ; Wed, 28 Oct 2009 05:47:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.244.4 with SMTP id r4mr8433893ybh.127.1256734071889; Wed, 28 Oct 2009 05:47:51 -0700 (PDT) In-Reply-To: References: <9ac0c6aa0910280453y1c35c80dr204713f202bde244@mail.gmail.com> Date: Wed, 28 Oct 2009 08:47:51 -0400 Message-ID: <9ac0c6aa0910280547l2d929ae9k376ccba121c299d3@mail.gmail.com> Subject: Re: Thread.interrupt() From: Michael McCandless To: java-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 OK, I agree we shouldn't burden people with another checked exception. But we should differentiate it, so our own exception, subclassing either RuntimeException or IOException sounds good. I think I'd prefer subclassing RuntimeException so that existing handlers do not in fact suppress it. If you are advanced enough to be calling Thread.interrupt (or using Futures, which can call Thread.interrupt), then you should be able to handle the resulting unchecked exception? Mike On Wed, Oct 28, 2009 at 8:37 AM, Uwe Schindler wrote: > I have seen this yesterday, too (when coming around the assert > Thread.holdsLock()), but I would not do that. How about defining a subcla= ss > of RuntimeException like InterruptedRuntimeException, so it does not need= to > be declared, but one could still catch it. > > Normally an interrupt inside Lucene would normally break a lot, so it is = not > done alone with catching it in user code? InterruptedException is only > useful if you want to really control coexistence of threads or break IO > operations, but I would not recommend to interrupt any foreign thread not > part of your code (like a merging thread). If this was done by someone, w= e > are fine with throwing a fatal error in the indexer. Maybe make it a > subclass of IOException (because the indexing IO is interrupted)? > > Uwe > > ----- > Uwe Schindler > H.-H.-Meier-Allee 63, D-28213 Bremen > http://www.thetaphi.de > eMail: uwe@thetaphi.de > >> -----Original Message----- >> From: Michael McCandless [mailto:lucene@mikemccandless.com] >> Sent: Wednesday, October 28, 2009 12:54 PM >> To: java-dev@lucene.apache.org >> Subject: Thread.interrupt() >> >> As a followon to LUCENE-1573, we had stated that in 3.0 instead of >> throwing RuntimeException when a Thread inside Lucene is interrupted, >> we would throw InterruptedException. >> >> Do we want to do this? =A0Technically I think it's the right thing to >> do, but, I started to implement it and found that it basically results >> in nearly every API now throwing InterruptedException (just like >> IOException). >> >> Thoughts? >> >> Mike >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org >> For additional commands, e-mail: java-dev-help@lucene.apache.org > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-dev-help@lucene.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org