lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: 2 exceptions in IndexWriter
Date Thu, 25 Jul 2013 17:28:36 GMT
Are you sure each test always closes the IndexWriter?

Still, it's best to have each test uses its own directory to avoid any
risk of confusing failures ...

Mike McCandless

http://blog.mikemccandless.com


On Thu, Jul 25, 2013 at 12:24 PM, Yonghui Zhao <zhaoyonghui@gmail.com> wrote:
> My test case first create an empty disk index folder then feed some doc
> then do some query.
>
> I purge the index by delete all files in the folder.
>
> My unit test has several test cases they use same directory in the disk.
> But it runs one by one,and I dont think there will be 2 threads use the
> directory at the same time.
>
> You suggestion makes sense. I will try if exception still happen if I only
> run 1 case or all test cases use different directories.
> 在 2013-7-25 下午7:38,"Michael McCandless" <lucene@mikemccandless.com>写道:
>
>> Can you describe what your test is doing?  How do you "purge the
>> index"?  It's best to open IndexWriter with OpenMode.CREATE to purge
>> (rather than remove the files yourself).
>>
>> Lock obtain timed out means another IndexWriter is currently using
>> that directory.
>>
>>
>>
>> Mike McCandless
>>
>> http://blog.mikemccandless.com
>>
>>
>> On Thu, Jul 25, 2013 at 12:26 AM, Yonghui Zhao <zhaoyonghui@gmail.com>
>> wrote:
>> > Recently I find my unit test will failed sometimes but no always.  I use
>> > Lucene 4.3.0
>> >
>> > After inverstigation, I found when I try to open a IndexWriter for a disk
>> > directory.
>> >
>> > Some time it will throw this exception:
>> >
>> > org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out:
>> > NativeFSLock@/tmp/test-idx/write.lock
>> >
>> > The default time out is 1000ms, when I set to 3000ms, seems this
>> exception
>> > disappeared.
>> > But I think 1000ms should be enough, how can it happen.   What's the
>> > recommended number?
>> >
>> >
>> > Some time it will throw another exception which I think is more serious.
>> >
>> > read past EOF: SimpleFSIndexInput
>> >
>> > Each test will purge the index folder,  however this exception will
>> happen
>> > sometimes.
>> >
>> > I don't know the reason, how can I fix this exception?
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message