[ 
https://issues.apache.org/jira/browse/LUCENE-4245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13420600#comment-13420600
 ] 

Mark Miller commented on LUCENE-4245:
-------------------------------------

bq. that calls IndexWriter.close() be a while loop as long as a 
ThreadInterruptedException is catched.

I could do that, but I think it means close is kind of 'trappy' - at least it 
should be a checked exception so people know they should always loop on close 
in case of an interrupt...though that seems odd to me.

Why would you interrupt close? Surely not so you can keep using the Writer? 
Surely not because it takes to long?

The only thing I can see interrupting is waiting for the background merge 
threads. Interrupts generally happen when something is trying to shutdown. 
Wouldn't you only interrupt if close was taking too long? Your still going to 
close your directory right after. It's not like you are going to interrupt a 
close so you can continue using the Writer? That seems like a crazy use case. 
At most, it would seem to mean, close faster if you can - not, abort, I still 
want to use you! ABORT ABORT! I've got a document to add!!
                
> IndexWriter#close(true) should either not be interruptible or should abort 
> background merge threads before returning
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-4245
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4245
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/index
>            Reporter: Mark Miller
>            Assignee: Uwe Schindler
>            Priority: Minor
>         Attachments: LUCENE-4245.patch, LUCENE-4245.patch
>
>
> Currently, there is no safe way to close a directory after closing the writer 
> without causing an exception in a merge thread if the #close call is 
> interrupted.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Reply via email to