dirstate locks don't work on Apple AFP network mounts

Bug #114528 reported by Matt Wilson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
In Progress
Medium
Robert Collins

Bug Description

Using bzr 0.16.0 under python 2.4 on Mac OS X (installed from MacPorts). Working dir/repos is on a network (AFP) share served from a Mac OS X machine, and from the looks of it AFP doesn't support some of the necessary locking.

bzr init and/or bzr upgrade (depending whether I'm in an existing repos or not) give me the following error:

bzr: ERROR: Could not acquire lock [Errno 45] Operation not supported
/opt/local/lib/python2.4/site-packages/bzrlib/lock.py:79: UserWarning: lock on <open file u'/Volumes/WebServer/work_dir/.bzr/checkout/dirstate', mode 'wb+' at 0x1225de8> not released
  warn("lock on %r not released" % self.f)
Exception exceptions.IOError: (45, 'Operation not supported') in <bound method _fcntl_WriteLock.__del__ of <bzrlib.lock._fcntl_WriteLock object at 0x1248690>> ignored
/opt/local/lib/python2.4/site-packages/bzrlib/lockable_files.py:110: UserWarning: file group LockableFiles(<bzrlib.transport.local.LocalTransport url=file:///Volumes/WebServer/work_dir/.bzr/checkout/>) was not explicitly unlocked
  warn("file group %r was not explicitly unlocked" % self)

Revision history for this message
Matt Wilson (matt-particle) wrote :

Problem still exists under 0.90.0.

Revision history for this message
Richard Lawrence (wyley-r) wrote :

I have the same error using bzr 1.2.0 on OS X 10.4. Not sure if it has the same underlying cause or not. I am trying to branch from a Samba share that I have mounted at ~/share/bzrroot:

bzr: ERROR: Could not acquire lock "[Errno 45] Operation not supported"
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/bzrlib/lock.py:79: UserWarning: lock on <open file u'/Users/richard/share/bzrroot/DjangoDev/trunk/pubassist/.bzr/checkout/dirstate', mode 'rb' at 0x16b66e0> not released
  warn("lock on %r not released" % self.f)
Exception exceptions.IOError: (45, 'Operation not supported') in <bound method _fcntl_ReadLock.__del__ of <bzrlib.lock._fcntl_ReadLock object at 0x16b0a70>> ignored

Revision history for this message
Barry Wark (barrywark) wrote :

Same error still present when branching to an AFP mounted volume in OS X 10.5 (client and server):

bzr: ERROR: Could not acquire lock "[Errno 45] Operation not supported"
/Library/Python/2.5/site-packages/bzrlib/lock.py:79: UserWarning: lock on <open file u'/automount/Servers/rieke-server.physiol.washington.edu/Volumes/Data/Users/barry/Desktop/ipython1-dev/.bzr/checkout/dirstate', mode 'wb+' at 0x1c1aa88> not released
  warn("lock on %r not released" % self.f)
Exception exceptions.IOError: (45, 'Operation not supported') in <bound method _fcntl_WriteLock.__del__ of <bzrlib.lock._fcntl_WriteLock object at 0x1c3c3b0>> ignored
/Library/Python/2.5/site-packages/bzrlib/lockable_files.py:110: UserWarning: file group LockableFiles(<bzrlib.transport.local.LocalTransport url=file:///automount/Servers/rieke-server.physiol.washington.edu/Volumes/Data/Users/barry/Desktop/ipython1-dev/.bzr/checkout/>) was not explicitly unlocked
  warn("file group %r was not explicitly unlocked" % self)

Revision history for this message
Barry Wark (barrywark) wrote :

...sorry. I'm using bzr 1.2.

Revision history for this message
Barry Wark (barrywark) wrote :

Some info on file locking in AFP is available at http://developer.apple.com/technotes/fl/fl_37.html

James Westby (james-w)
Changed in bzr:
status: New → Confirmed
Revision history for this message
Martin Pool (mbp) wrote :

Thanks for the pointer Barry.

Is there any unix/python api that will use the locks on AFP?

Changed in bzr:
importance: Undecided → Medium
Revision history for this message
Barry Wark (barrywark) wrote : Re: [Bug 114528] Re: New working tree format broken on AFP network mounts (locking error)

Martin,

I'm not sure (and I'm certainly no expert on AFP). I will poke around
and see what I can find and report back.

Barry

On Tue, Mar 18, 2008 at 7:39 PM, Martin Pool <email address hidden> wrote:
> Thanks for the pointer Barry.
>
> Is there any unix/python api that will use the locks on AFP?
>
> ** Changed in: bzr
> Importance: Undecided => Medium
>
> ** Summary changed:
>
>
> - New working tree format broken on AFP network mounts (locking error)
> + dirstate locks don't work on Apple AFP network mounts
>
> ** Tags added: dirstate locking
>
> --
> dirstate locks don't work on Apple AFP network mounts
>
>
> https://bugs.launchpad.net/bugs/114528
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Bazaar Version Control System: Confirmed
>
> Bug description:
> Using bzr 0.16.0 under python 2.4 on Mac OS X (installed from MacPorts). Working dir/repos is on a network (AFP) share served from a Mac OS X machine, and from the looks of it AFP doesn't support some of the necessary locking.
>
> bzr init and/or bzr upgrade (depending whether I'm in an existing repos or not) give me the following error:
>
> bzr: ERROR: Could not acquire lock [Errno 45] Operation not supported
> /opt/local/lib/python2.4/site-packages/bzrlib/lock.py:79: UserWarning: lock on <open file u'/Volumes/WebServer/work_dir/.bzr/checkout/dirstate', mode 'wb+' at 0x1225de8> not released
> warn("lock on %r not released" % self.f)
> Exception exceptions.IOError: (45, 'Operation not supported') in <bound method _fcntl_WriteLock.__del__ of <bzrlib.lock._fcntl_WriteLock object at 0x1248690>> ignored
> /opt/local/lib/python2.4/site-packages/bzrlib/lockable_files.py:110: UserWarning: file group LockableFiles(<bzrlib.transport.local.LocalTransport url=file:///Volumes/WebServer/work_dir/.bzr/checkout/>) was not explicitly unlocked
> warn("file group %r was not explicitly unlocked" % self)
>

Revision history for this message
Kannan Goundan (cakoose) wrote :

One more data point:

Installed bzr-1.6.1rc1, Mac OS 10.4 disk image
> bzr --version
Bazaar (bzr) 1.6.1rc1
  Python interpreter: /Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/Contents/MacOS/Python 2.5.2
  Python standard library: /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5
  bzrlib: /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/bzrlib

Tried running "bzr init" on NFS-mounted directory
> bzr init
bzr: ERROR: Could not acquire lock "[Errno 45] Operation not supported"
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/bzrlib/lock.py:79: UserWarning: lock on <open file u'/private/var/automount/s/kannan/Develop/CS-132-Assignments/Stoop/.bzr/checkout/dirstate', mode 'wb+' at 0x2012de8> not released
  warn("lock on %r not released" % self.f)
Exception exceptions.IOError: (45, 'Operation not supported') in <bound method _fcntl_WriteLock.__del__ of <bzrlib.lock._fcntl_WriteLock object at 0x200dad0>> ignored
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/bzrlib/lockable_files.py:116: UserWarning: LockableFiles(<bzrlib.transport.local.LocalTransport url=file:///private/var/automount/s/kannan/Develop/CS-132-Assignments/Stoop/.bzr/checkout/>) was gc'd while locked
  warnings.warn("%r was gc'd while locked" % self)

Is there anything I can do to work around this?

Revision history for this message
Vincent Ladeuil (vila) wrote :

@kannan: you should contact your NFS server admin and ask him to enable locking on the NFS server. If that doesn't work, file another bug, please. *This* bug is about AFP not NFS.

Revision history for this message
Winston Wolff (winstonw) wrote :

Any news on this bug? I have switched back to Subversion because of this problem--at work I use network home folders so bzr cannot be used.

Revision history for this message
Barry Wark (barrywark) wrote : Re: [Bug 114528] Re: dirstate locks don't work on Apple AFP network mounts

On Sat, Oct 18, 2008 at 4:16 PM, Winston Wolff <email address hidden> wrote:
> Any news on this bug? I have switched back to Subversion because of
> this problem--at work I use network home folders so bzr cannot be used.
>

No news, and I have had to switch back to subversion, as you have. The
bzr developers were happy to help resovlve the issue if they knew how
to create locks on AFP volumes. I did a bit of searching, but nothing
came up. If you know any of the relevant APIs (or pointers to same),
I'd be happy to get that info to the bzr guys.

barry

> --
> dirstate locks don't work on Apple AFP network mounts
> https://bugs.launchpad.net/bugs/114528
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Bazaar Version Control System: Confirmed
>
> Bug description:
> Using bzr 0.16.0 under python 2.4 on Mac OS X (installed from MacPorts). Working dir/repos is on a network (AFP) share served from a Mac OS X machine, and from the looks of it AFP doesn't support some of the necessary locking.
>
> bzr init and/or bzr upgrade (depending whether I'm in an existing repos or not) give me the following error:
>
> bzr: ERROR: Could not acquire lock [Errno 45] Operation not supported
> /opt/local/lib/python2.4/site-packages/bzrlib/lock.py:79: UserWarning: lock on <open file u'/Volumes/WebServer/work_dir/.bzr/checkout/dirstate', mode 'wb+' at 0x1225de8> not released
> warn("lock on %r not released" % self.f)
> Exception exceptions.IOError: (45, 'Operation not supported') in <bound method _fcntl_WriteLock.__del__ of <bzrlib.lock._fcntl_WriteLock object at 0x1248690>> ignored
> /opt/local/lib/python2.4/site-packages/bzrlib/lockable_files.py:110: UserWarning: file group LockableFiles(<bzrlib.transport.local.LocalTransport url=file:///Volumes/WebServer/work_dir/.bzr/checkout/>) was not explicitly unlocked
> warn("file group %r was not explicitly unlocked" % self)
>

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

We have a new working tree that may work better; as long as its attached to a writable replica that is ;) - it does not need OSLocks on the file system. Its not quite ready for user testing, I will post here when it is.

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.