lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <>
Subject Re: Locking problems with NFS
Date Tue, 20 Apr 2004 19:00:07 GMT
Francesco Bellomi wrote:
> The only problem is that, as lucene 1.4rc2, FSDirectory is 'final'.

Please submit a patch to lucene-dev to make FSDirectory non-final.

> In fact, a third architectural approach would be to define an API for
> "pluggable" lock implementations: IMHO that would be more robust to changes
> in the Directory interface and implementations.

If you have a proposal, submit a patch to lucene-dev to make locking 

FYI, I just ran across another NFS-safe locking approach:

#    In NFS, the O_CREAT|O_EXCL isn't guaranteed to be atomic.
#    So we create a temp file that is probably unique in space
#    and time ($folder.lock.$time.$pid.$host).
#    Then we use link to create the real lock file. Since link
#    is atomic across nfs, this works.

This is from:

Unfortunately links are not supported by Java's io APIs, so I think the 
dotlock+fcntl() is probably best for Lucene.


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

View raw message