lucene-dev mailing list archives

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

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:
Lock@E:\jakarta-tomcat-4.0.1\webapps\search\WEB-INF\data\TEST\write.lock

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

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

Max

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 org.apache.lucene.store.Lock.run()).  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,
 Maxim                            mailto:max@osua.de


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


Mime
View raw message