lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jed Wesley-Smith <>
Subject Re: IllegalStateEx thrown when calling close
Date Fri, 31 Oct 2008 03:26:38 GMT
Thanks Mike!

Michael McCandless wrote:
> OK I'll add that (what IW does on setting an OOME) to the javadocs.
> Mike
> Jed Wesley-Smith wrote:
>> Mike,
>> regarding this paragraph:
>> "To workaround this, on catching an OOME on any of IndexWriter's
>> methods, you should 1) forcibly remove the write lock
>> (IndexWriter.unlock static method) and then 2) not call any methods on
>> the old writer.  Even if the old writer has concurrent merges running,
>> they will refuse to commit on seeing that an OOM had occurred."
>> I'm not sure that an IndexWriter is particularly useful once its 
>> hitOOM flag is set to true, whether autocommit is true or not. Once 
>> it is true you can't do anything with it (it reverts to its last 
>> commit point and stays there) and need to discard it. I am suggesting 
>> that this could be documented as it is not immediately obvious 
>> without coming across it and debugging it. That being said, the VM is 
>> probably not that useful once OOMEs are flying around anyway :-)
>> cheers,
>> jed.
>> Michael McCandless wrote:
>>> Jed Wesley-Smith wrote:
>>>> Yeah, I saw the change to flush(). Trying to work out the correct 
>>>> strategy for our IndexWriter handling now. We probably should not 
>>>> be using autocommit for our writers.
>>> autoCommit=true is deprecated as of 2.4.0, and will go away when we 
>>> finally get to 3.0, so I think switching to false, and possibly 
>>> changing your app to periodically commit() if you were relying on 
>>> those semantics, is a good step forward.
>>>> It was brought up by others that the OutOfMemoryError handling 
>>>> requirements are a fairly strong part of the contract now - but 
>>>> aren't documented. Do you think the last paragraph below should be 
>>>> incorporated into the class JavaDoc?
>>> Well, that paragraph is a workaround for the issue you hit, which 
>>> only applies when autoCommit is true, so going forward (or, if you 
>>> use autoCommit=false) you should simply close the IndexWriter.

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

View raw message