lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maxim Patramanskij <>
Subject Re: No timeout for "write.lock"
Date Wed, 07 May 2003 19:27:33 GMT

I've experienced a problem with the index updating if it takes place
very soon (some seconds) after creating one. I've got IOException with
the following message:

Index locked for write:

If I do updating after more then 10 seconds everything is working just

I guess this is the problem of how Windows locks/releases files. This
sort of problem was already mentioned regarding to
FSDirectory.renameFile method.


SG> I've come across something in the locking mechanism that is causing me 
SG> grief.  Often, in the course of obtaining locks, Lucene uses a mechanism 
SG> that waits for a lock to become available and times out after 10 seconds 
SG> (see  There are two cases where 
SG> this process is not used, though, (both are for the "write.lock" and the 
SG> attempt to lock will immediately throw an Exception:

SG> 1) IndexWriter constructor.  During construction, obtaining index.write 
SG> lock is attempted and if it is denied, the Exception is thrown.  (Later, 
SG> the same method does use the timeout mechanism wait for the commit.lock 
SG> to be obtained.)

SG> 2) IndexReader.delete().  This will also fail immediately if the 
SG> write.lock can't be obtained.

SG> Is there a reason/what is the reason why the write.lock isn't using the 
SG> wait/timeout mechanism?  I'd really like to increase the chances of a 
SG> successful write and this seems like a straightforward way to do it...

SG> Thanks,
SG> Scott

Best regards,

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

View raw message