lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (JIRA)" <>
Subject [jira] [Commented] (LUCENE-4649) kill ThreadInterruptedException
Date Wed, 02 Jan 2013 21:08:12 GMT


Michael McCandless commented on LUCENE-4649:

bq.  The official documentation explicitely mention that IO-related code that gets interrupted
must throw which is exactly defined as we use it.

InterruptedIOException sounds great!

bq. The problem is that indexwriter relies upon certain types of exceptions (e.g. ThreadInterruptedException)
instead of checking interrupt status?

+1 to just check the interrupted bit.

bq. Really as part of this issue we should re-enable mmap/niofs for TestIndexWriter.testThreadInterruptDeadlock()


bq. this whole thing should act like IOUtils.close() and have a 'Exception priorException'.


bq. We can check the interrupt bit to determine that we should not wait when calling finishMerges(),
but thats it!


I looked at the patch ... I don't like how we throw RuntimeException
on interrupt (I think that's worse than throwing
ThreadInterruptedException).  Maybe in those places we should instead add
"throws InterruptedException" to the method (eg NRTManager.close)?

> kill ThreadInterruptedException
> -------------------------------
>                 Key: LUCENE-4649
>                 URL:
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Robert Muir
>         Attachments: LUCENE-4649_broken.patch, LUCENE-4649.patch
> the way we currently do this is bogus.
> For example in FSDirectory's fsync, i think we should instead:
> {noformat}
> } catch (InterruptedException ie) {
> - throw new ThreadInterruptedException(ie);
> + Thread.currentThread().interrupt(); // restore status
> + IOException e = new"fsync() interrupted");
> + e.initCause(ie);
> + throw e;
> {noformat}
> and crazy code in IndexWriter etc that catches ThreadInterruptedExc just to restore status
should be removed. 
> Instead the guy doing the catch (InterruptedException) should do the right thing.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message