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

Uwe Schindler edited comment on LUCENE-4246 at 12/23/12 3:50 PM:
-----------------------------------------------------------------

bq. Then we should remove java.io.Closeable interface from IndexWriter. This is 
especially bad for java7 users who have syntactical support from the language 
for doing things "the wrong way".

Let's make IndexWrite do nothing additional like merging or similar stuff. I 
already fixed some leaks in the past, but the ones discussed here are more 
crazy (like InterruptedException handling).

-1 to remove Closeable, if the semantics of closeable are correct. This is 
currently not the case, but one we fix to close without committing and so on, 
we are fine. The syntactic sugar here is good, because it warns you (when 
writing tests) that you miss to close. Somebody using a try-with-resources 
block is a different story, but if somebody wants to do this he can really do 
that (and its useful for lots of tasks). It is just the "one long running 
thread keeps IndexWriter open and indexes documents that you may think of. But 
when its run() method ends, the IndexWriter should be closed, too. So Closeable 
is perfectly fine. And we cannot prevent people from writing ineffective code, 
but those people would not use try-with-resources at all.
                
      was (Author: thetaphi):
    bq. Then we should remove java.io.Closeable interface from IndexWriter. 
This is especially bad for java7 users who have syntactical support from the 
language for doing things "the wrong way".

Let's make IndexWrite do nothing additional like merging or similar stuff. I 
already fixed some leaks in the past, but the ones discussed here are more 
crazy (like InterruptedException handling).

-1 to remove Closeable, if the semantics of closeable are correct this is 
currently not the case, but one we fix to close without committing and so on, 
we are fine. The syntactic sugar here is good, because it warns you (when 
writing tests) that you miss to close. Somebody using a try-with-resources 
block is a different story, but if somebody wants to do this he can really do 
that (and its useful for lots of tasks). It is just the "one long running 
thread keeps IndexWriter open and indexes documents). But when its run() method 
ends, the IndexWriter should be closed, too. So Closeable is perfectly fine. 
And we cannot prevent people from writing ineffective code.
                  
> 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