lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ketan Deshpande <>
Subject Re: LockObtainFailedException exception
Date Sun, 29 Mar 2009 15:58:19 GMT
Hi Mike,
  Thanks for the response. I did a code check but this was a random error, which indicated
towards something to do with the environment. Finally, I did figure out the problem - low
disk space. Though there was around 1 GB of free space on the server, it was not sufficient
when we had to merge a large number of indexes. Anyway, we have now done the needful and the
problem hasnt recurred again!

--- On Mon, 2/3/09, Michael McCandless <> wrote:

From: Michael McCandless <>
Subject: Re: LockObtainFailedException exception
Date: Monday, 2 March, 2009, 10:24 PM

Is it possible you accidentally allow two writers to try to open the index?

That would explain this failure; the 2nd writer would fail to acquire the lock, because the
first writer has the index open.

Or, is it possible you're not closing a previously opened writer?


Ketan Deshpande wrote:

> Hi,
>   I am fairly new to Lucene, so forgive my elaborate explanation. We were facing frequent
issues with Lucene 1.2 (Unreleased write.lock() files). To overcome the same, we have recently
upgraded to Lucene 2.3.2 - however, we observed the following LockObtainFailedException exception
during our testing -
> 2009-02-26 15:34:35,525 DEBUG [] Document()
> 2009-02-26 15:34:35,529 DEBUG [] adding
associated type
> 2009-02-26 15:34:35,529 DEBUG [] added
> 2009-02-26 15:34:36,535 ERROR [STDERR]
Lock obtain timed out:
> SimpleFSLock@/jboss/jboss-4.0.5.GA/spool/lucene/search1/index/PRNJ_2009_02/write.lock
> 2009-02-26 15:34:36,536 ERROR [STDERR]  at
> 2009-02-26 15:34:36,536 ERROR [STDERR]  at org.apache.lucene.index.IndexWriter.init(
> 2009-02-26 15:34:36,536 ERROR [STDERR]  at org.apache.lucene.index.IndexWriter.<init>(
> 2009-02-26 15:34:36,536 ERROR [STDERR]  at
> 2009-02-26 15:34:36,536 ERROR [STDERR]  at
> 2009-02-26 15:34:36,536 ERROR [STDERR]  at
> 2009-02-26 15:34:36,536 ERROR [STDERR]  at sun.reflect.GeneratedMethodAccessor106.invoke(Unknown
> 2009-02-26 15:34:36,536 ERROR [STDERR]  at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(
> 2009-02-26 15:34:36,536 ERROR [STDERR]  at java.lang.reflect.Method.invoke(
> 2009-02-26 15:34:36,536 ERROR [STDERR]  at org.jboss.invocation.Invocation.performCall(
>   From the stack trace, we can trace back the exception to the following code in the
IndexWriter class (while trying to acquire a lock):
> Lock writeLock = directory.makeLock(IndexWriter.WRITE_LOCK_NAME);
> if (!writeLock.obtain(writeLockTimeout)) // obtain write lock
>     throw new LockObtainFailedException("Index locked for write: " + writeLock);
>   We have seen this issue only once till now and the files did not index until we
deleted the lock file manually. (When I checked for existing issues, Lucene-715 came closest,
but it has been resolved in 2.1 version) I am afraid this may crop up sometime again. Any
inputs on how to resolve the the error would be appreciated. If any more details are required,
I would be happy to share the same.
> Thanks,
> Ketan
> Bollywood news, movie reviews, film trailers and more! Click here.

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

      Add more friends to your messenger and enjoy! Go to
View raw message