[BUG] readonly operations interfere with each other

Martin Pool mbp at sourcefrog.net
Sat May 21 01:26:04 BST 2005

On Thu, 2005-05-19 at 11:00 -0400, Aaron Bentley wrote:

> If you invoke "bzr log|less" and then "bzr diff -r 535|less", the diff
> output will be blank until you reach the bottom in the log listing.  I
> assume both operations lock the branch.  It would be handy if you could
> execute two readonly operations at the branch.  

This was a fairly simple bug -- cmd_diff wasn't opening the Branch in
readonly mode.  (The default is write mode, on the grounds that locking
too much will be noticed and fixed (as here) but locking not enough
might be dangerous.)

> 1. the read lock can only be acquired when the write lock is not active.
> ~ The read lock can be acquired by several processes simultaneously, and
> is reference-counted.
> 2. the write lock can only be acquired when the read lock is not active.
> ~ The write lock can only be acquired by one process at a time.

Yes, this is just what it does using file locks.  We may need to put
some thought into how to support this well on dumb remote filesystems.


More information about the bazaar mailing list