lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "S Edirisinghe" <edirisingh...@gmail.com>
Subject Re: opening an IndexWriter for an exisiting index causing lock exception
Date Tue, 09 Jan 2007 01:53:10 GMT
Thanks Mike, you are right. There was a really bad test method that didn't
clean up after itself. Thanks for the heads up. This was not a Lucene
problem, it was just me not going through all of the unit test methods.

On 1/8/07, Michael McCandless <lucene@mikemccandless.com> wrote:
>
> S Edirisinghe wrote:
>
> > I'm having a write lock problem when I try to open an existing index.
> > When I try to open the index with the recreate set to false, I get this
> > exception
> >
> > java.io.IOException: Lock obtain timed out: Lock@/tmp/lucene-
> > e683c0b3e52b8094bba62b22617efd41-write.lock
> >    at org.apache.lucene.store.Lock.obtain(Lock.java:58)
> >    at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:255)
> >    at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:205)
> >    at im.service.search.impl.InfomunityLuceneIndexManager.openIndex(
> > InfomunityLuceneIndexManager.java:108)
> >    at im.service.search.impl.InfomunityLuceneIndexManager.<init>(
> > InfomunityLuceneIndexManager.java:71)
> >    at im.service.search.impl.test.InfomunityLuceneIndexManagerTest
> .<init>(
> > InfomunityLuceneIndexManagerTest.java:31)
> >    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> >    at sun.reflect.NativeConstructorAccessorImpl.newInstance(
> > NativeConstructorAccessorImpl.java:39)
> >    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
> > DelegatingConstructorAccessorImpl.java:27)
> >    at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
> >    at org.junit.internal.runners.TestClassMethodsRunner.createTest(
> > TestClassMethodsRunner.java:60)
>
> Which version of Lucene are you using?
>
> By far the most common cause of this is a leftover lock file from a
> previous un-graceful exit.
>
> But it sounds like you've checked that already.
>
> So if you're certain that this lock file name is not in fact present
> when you start your application, maybe double check that no other code
> is creating an IndexWriter (or that your openIndex is not being called
> more than once)?  Or you're not running two threads through this code?
>
> Actually, since you're running under Junit, are you sure there wasn't
> another test case that had failed to close its writer against this
> index?
>
> Mike
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message