dirstate locks can fail on nfs

Bug #108605 reported by Markus F.X.J. Oberhumer
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
In Progress
Medium
Robert Collins

Bug Description

Info from /proc/mounts:

192.168.6.36:/raid/data/test /mnt/n5200 nfs rw,nosuid,nodev,noatime,vers=3,rsize=32768,wsize=32768,hard,proto=tcp,timeo=600,retrans=2,sec=sys,addr=192.168.6.36 0 0

mfx@harmonia:/mnt/n5200/cvs/00-vc/bzr.dev > bzr --no-plugins -Derror update
bzr: ERROR: bzrlib.errors.LockContention: Could not acquire lock [Errno 37] No locks available

Traceback (most recent call last):
  File "/home/local/opt/cc-i386-linux/packages/bzr-0.15/bzrlib/commands.py", line 650, in run_bzr_catch_errors
  File "/home/local/opt/cc-i386-linux/packages/bzr-0.15/bzrlib/commands.py", line 612, in run_bzr
  File "/home/local/opt/cc-i386-linux/packages/bzr-0.15/bzrlib/commands.py", line 304, in run_argv_aliases
  File "/home/local/opt/cc-i386-linux/packages/bzr-0.15/bzrlib/builtins.py", line 1027, in run
  File "/home/local/opt/cc-i386-linux/packages/bzr-0.15/bzrlib/workingtree_4.py", line 598, in lock_tree_write
  File "/home/local/opt/cc-i386-linux/packages/bzr-0.15/bzrlib/workingtree_4.py", line 582, in _lock_self_write
  File "/home/local/opt/cc-i386-linux/packages/bzr-0.15/bzrlib/dirstate.py", line 2308, in lock_write
  File "/home/local/opt/cc-i386-linux/packages/bzr-0.15/bzrlib/lock.py", line 146, in __init__
LockContention: Could not acquire lock [Errno 37] No locks available

bzr 0.15.0 on python 2.4.3.final.0 (linux2)
arguments: ['/home/mfx/local/bin/bzr', '--no-plugins', '-Derror', 'update']

** please send this report to <email address hidden>
/opt/cc-i386-linux/packages/bzr-0.15/bzrlib/lock.py:79: UserWarning: lock on <open file u'/mnt/n5200/cvs/00-vc/bzr.dev/.bzr/checkout/dirstate', mode 'rb+' at 0xf78b0770> not released
  warn("lock on %r not released" % self.f)

Related branches

Revision history for this message
Martin Pool (mbp) wrote :

Thanks for the bug report.

This error is occurring because we're trying to take an os-level file lock, and this sometimes doesn't work on nfs setups. You should be able to avoid this for now by making sure the nfs lockd is running on your server (which is probably a good idea anyhow); we will try to remove the dependency in a future release.

Changed in bzr:
importance: Undecided → Medium
status: Unconfirmed → Confirmed
Revision history for this message
Markus F.X.J. Oberhumer (markus-oberhumer) wrote :

Thanks for the feedback - the missing rpc.lockd on the server seems indeed to be the cause of the problem (but I cannot fix that machine).

As a workaround adding "nolock" to the NFS mount options seems to be enough to make "bzr update" work again, though I'm not sure about the implications of that.

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 108605] Re: dirstate locks can fail on nfs

On 4/24/07, Markus F.X.J. Oberhumer <email address hidden> wrote:
> Thanks for the feedback - the missing rpc.lockd on the server seems
> indeed to be the cause of the problem (but I cannot fix that machine).
>
> As a workaround adding "nolock" to the NFS mount options seems to be
> enough to make "bzr update" work again, though I'm not sure about the
> implications of that.

It might cause trouble if you tried to update the working tree
simultaneously from two nfs clients, which may be unlikely.

--
Martin

tags: added: dirstate2
Revision history for this message
Robert Collins (lifeless) wrote :

We have an experimental format which won't need OSLocks, we will need testing on it on NFS, but its not quite there yet - it needs some more peer review and tradeoff examinations.

Changed in bzr:
status: Confirmed → In Progress
assignee: nobody → Robert Collins (lifeless)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.