lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yonik Seeley <yo...@lucidimagination.com>
Subject Re: Thread.interrupt()
Date Wed, 28 Oct 2009 12:22:17 GMT
On Wed, Oct 28, 2009 at 7:53 AM, Michael McCandless
<lucene@mikemccandless.com> wrote:
> 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?  Technically 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?

One should not get an interrupted exception unless one specifically
interrupts the thread with the IndexWriter.
For the casual user, it doesn't seem useful to burden them with
InterruptedException, esp since they would normally not be able to
deal with it in a satisfactory manner anyway.
For an advanced user having a specific exception type could be
useful... so InterruptedRuntimeException?  Or should it be a subclass
of IOException so it will be handled by the catch blocks already in
the users code?

-Yonik
http://www.lucidimagination.com

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message