[Omake] Locking and NFS

Aleksey Nogin nogin at metaprl.org
Mon Dec 18 09:45:08 PST 2006


Phil,

Thanks a lot for your report,

On 18.12.2006 05:12, Phil Endecott wrote:

> I like the look of OMake and look forward to being able to try it out.  
> Unfortunately I have not got very far yet due to this:
> 
> $ omake hello
> Fatal error: exception Failure("Failed to lock the file .omakedb.lock: 
> No locks available")
> 
> This is an NFS filesystem and it does not support locking.

The problem here is that on your system for some reason the lockf call 
results in errno set to ENOLCK (which is supposed to mean "the request 
would cause the number of locks to exceed a system-imposed limit") 
instead of the EOPNOTSUPP (which is what normally happens on those NFS 
fylesystems). We already handle the EOPNOTSUPP case as a warning; I 
guess we should do the same for the ENOLCK as well...

I made the ENOLCK non-fatal in rev 9888 (in OMake development three on 
Subversion).

> I have read bug 555 (http://bugzilla.metaprl.org/show_bug.cgi?id=555) 
> and it points out that the "--dotomake dir" option can be used to move 
> the cache files to somewhere other than $HOME/.omake, i.e. a filesystem 
> that does have locking.  But the error that I'm getting is not with 
> $HOME/.omake, it's with ./.omakedb.lock.  Is there a way to put this 
> file somewhere different?

No. We have to kinds of caches:
- Per source file (which contains the parsed version of the file, the 
results of the "static." (AKA --configure) sections, etc). Those have 
the .omc extension and can be relocated with "--dotomake dir" or even 
"--dotomake dir --force-dotomake "

- The .omakedb file (locked via the .omakedb.lock) in the project root. 
Currently, there is no support for relocating this one.

> Can you help me understand what purpose these locks serve?  There is no 
> chance of me running two simultaneous builds in the same directory.  It 
> is possible but unlikely that I might want to build two different 
> projects in different directories simultaneously (hence the locks in 
> $HOME/.omake I suppose).

In our experience, it is not that unusual to accidentally run more than 
one copy of omake on the same project. Note that OMake has a "filesystem 
watch" mode (-p and -P options), where upon being stuck on an error 
(-p/-P) or once finished (-P only) it would start monitoring the 
filesystem and resume as soon as a source file changes. There it is not 
that impossible to forget you have one of those running in the 
background and attempt to start another one.

Also, when an NFS filesystem is mounted with locking (via the lockd), 
then the locking would protect against instances of OMake running on a 
different machine as well.

Note, however that we have tried to make sure that OMake would still do 
something reasonable when the locking is unavailable. As I said earlier, 
we just have not accounted for the ENOLCK case (yet).

> Note that it takes several seconds for the above error to appear - I 
> think there is some sort of timeout occuring.
> 
Hm, strange. What kind of operating system are you using? Are you sure 
that your NFS partition is mounted without the locking support and the 
error is not caused by the lockd malfunctioning somehow?

Aleksey


More information about the Omake mailing list