lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy Hind (JIRA)" <>
Subject [jira] Commented: (LUCENE-307) Lock obtain time out errors when opening readers and writers
Date Fri, 23 Jun 2006 16:01:30 GMT
    [ ] 

Andy Hind commented on LUCENE-307:

I have seen something similar.

When the lock file is deleted the return value is not checked.
I have seen cases where the lock file is left by this call when you would expect it to be

I suspect that checking the file exists or trying to create the lock file can prevent it from
being deleted.
Other processes could also be preventing the deletion,  but not in my case.
It seems to be more likely under heavy lock load.

It would be simple to retry the delete and report an exception if the lock file could not
eventually be deleted by the owner.

There is also no reason why there can not be a single shared lock of each type for the singe
instance of the FSDirectory.
I suspect there are many use cases where all that is required is in-JVM locking.

I am all for lucene using nio locking and pluggable locking.

For in-JVM locking with nio you have to use the same file channel instance for locking. In
this patch I do not think that is the case as a new RAF and channel instance will be created
for each new lock instance.  

> Lock obtain time out errors when opening readers and writers
> ------------------------------------------------------------
>          Key: LUCENE-307
>          URL:
>      Project: Lucene - Java
>         Type: Bug

>   Components: Other
>     Versions: 1.4
>  Environment: Operating System: All
> Platform: All
>     Reporter: Reece (YT)
>     Assignee: Lucene Developers
>  Attachments:,
> The attached Java file shows a locking issue that occurs with Lucene 1.4.2.
> One thread opens and closes an IndexReader.  The other thread opens an
> IndexWriter, adds a document and then closes the IndexWriter.  I would expect
> that this app should be able to happily run without an issues.
> It fails with:
> Lock obtain timed out
> Is this expected?  I thought a Reader could be opened while a Writer is adding a
> document.
> I am able to get the error in less than 5 minutes when running this on Windows
> XP and Mac OS X.
> Any help is appreciated.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

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

View raw message