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

Mark Miller commented on LUCENE-4246:
-------------------------------------

+1 on addressing this issue!

Can I just point out that the 'proper' way to close an IndexWriter is perhaps:

{code}
 while (true) {
      try {
        super.close();
      } catch (ThreadInterruptedException e) {
        // don't allow interruption
        continue;
      } catch (Exception e) {
        iw.rollback(); // mabye
      }
      break;
    }
{code}

Except we don't know if rollback is good enough there yet, and it's a little 
scary to have the while loop on the interrupted exception without a timeout. 
Writing a line of code to close the IW is an expert task if you want to get it 
right. If its currently possible to get it right.

So perhaps thats what you need for a safe close. How many people do you think 
are doing that? Can we agree that it's insane that you do have to do that? Have 
you ever seen anything like it?

Let's come to some compromise on exactly what close does so that we can un 
crazify it.
                
> Fix IndexWriter.close() to not commit or wait for pending merges
> ----------------------------------------------------------------
>
>                 Key: LUCENE-4246
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4246
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Robert Muir
>            Assignee: Robert Muir
>             Fix For: 4.1
>
>


--
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: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to