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

Michael McCandless commented on LUCENE-4246:
--------------------------------------------

I agree it'd make IndexWriter more verbose for simple apps, which is not great, 
but it'd also make it more transparent, which may be the right tradeoff here.  
It's important for apps to know that IW.waitForMerges can sometimes take a very 
long time.  Also, in issues like LUCENE-4638, it'd be clearer what went wrong, 
ie Mark would have hit the exception during commit().

Those two exceptions from IW.close() are there to catch coding errors, ie the 
app was not explicit about whether it wanted to abort merges and discard 
changes.  What to do about those exceptions would be clear: you either rollback 
or commit, and you either waitForMerges or abortMerges, before calling close.

close() does too many things now, and they are surprising.  Maybe we should 
rename it to a new method to make it clear it "waits for merges, commits, 
closes", and then shift to the new semantics for close.

If we did this change, rollback() would discard changes since the last commit 
but NOT close.
                
> 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