lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "drazen.nis" <d.niko...@youngculture.com>
Subject Re: AlreadyClosedException after few hours of normal work
Date Fri, 22 Jul 2011 12:48:46 GMT
Hello Simon,

You guessed it right. We do call IW#rollback() but did not create new IW. We
called rollback in the case when the document could not be indexed for some
reason, to try it again.

Thank you for the answer. After fixing the code, it runs now stable.

Best Regards,
Drazen


Simon Willnauer wrote:
> 
> Hey,
> 
> are you guys calling IW#rollback() by any chance? the rollback will
> close you IW and you have to reopen it on the index. If so in which
> case are you calling rollback?
> 
> simon
> 
> On Wed, Jul 20, 2011 at 6:03 PM, drazen.nis
> &lt;d.nikolic@youngculture.com&gt; wrote:
>> Hello,
>>
>> We are using single instance of IndexWriter (and IndexSearcher) to
>> operate
>> with the Lucene index. There are a lot of threads around indexing and
>> searching against the index. Everything works just fine, but after few
>> hours
>> of normal work IndexWriter would be closed by itself. We open a single
>> instance of IndexWriter at the start and index/delete documents with it
>> (multithreaded) and execute commit() from time to time (IndexWriter is
>> opened with autoCommit=false). IndexSearcher, single instance too,
>> reopened
>> once per hour. The main app is communicating with code wrapped aroung
>> Lucene
>> using RMI.
>>
>> Do you have an idea what could be the cause of IndexWriter being closed,
>> since we do not close it nowhere explicitly into the code? And what is a
>> proper way to deal with AlreadyClosedException when trying to
>> add/update/delete document to the index?
>>
>>
>> Here are some details about our case:
>> Lucene 2.9
>>
>> Java 1.6.0_14
>> JAVA_OPTS=-Xms4000M -Xmx4000M -XX:-UseParallelOldGC
>> -XX:+PrintCommandLineFlags -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps
>> -XX:+PrintGCDetails -XX:+DisableExplicitGC -Xloggc:gc.log
>>
>> CentOS release 5.5 (Final)
>> 8 cores server (physical machine)
>> 18GB RAM
>> RAID5 HDD
>> (on this machine only Apache Web Server is running at the moment)
>>
>>
>> Stacktraces, when error starts to appear:
>> org.apache.lucene.store.AlreadyClosedException: this IndexWriter is
>> closed
>>        at
>> org.apache.lucene.index.IndexWriter.ensureOpen(IndexWriter.java:812)
>>        at
>> org.apache.lucene.index.IndexWriter.ensureOpen(IndexWriter.java:817)
>>        at
>> org.apache.lucene.index.IndexWriter.deleteDocuments(IndexWriter.java:2618)
>>
>> or
>>
>> org.apache.lucene.store.AlreadyClosedException: this IndexWriter is
>> closed
>>        at
>> org.apache.lucene.index.IndexWriter.ensureOpen(IndexWriter.java:812)
>>        at
>> org.apache.lucene.index.IndexWriter.ensureOpen(IndexWriter.java:817)
>>        at
>> org.apache.lucene.index.IndexWriter.commit(IndexWriter.java:4210)
>>        at
>> org.apache.lucene.index.IndexWriter.commit(IndexWriter.java:4196)
>>
>>
>> GC logs shows only young generation collections and, in addition to that,
>> I
>> have checked and did not see in the app logs OutOfMemoryException.
>>
>>
>> Note also that we use the same code (separate instances per index, of
>> course) to work with few more indexes in the same app. With those indexes
>> we
>> have no problems and AlreadyClosedException is never thrown. Though the
>> frequency of usage of those additional indexes (especially for reading)
>> is
>> much smaller than the first (the problematic) one.
>>
>> And one more thing: We also use near realtime search, for speeding up
>> deletes/updates, but we did not get any exceptions using it. Exceptions
>> occur when we try to delete a document or commit IndexWriter.
>>
>> Thanks for reading and your help.
>>
>> Best Regards,
>> Drazen
>>
>> --
>> View this message in context:
>> http://lucene.472066.n3.nabble.com/AlreadyClosedException-after-few-hours-of-normal-work-tp3185828p3185828.html
>> Sent from the Lucene - General mailing list archive at Nabble.com.
>>
> 


--
View this message in context: http://lucene.472066.n3.nabble.com/AlreadyClosedException-after-few-hours-of-normal-work-tp3185828p3191258.html
Sent from the Lucene - General mailing list archive at Nabble.com.

Mime
View raw message