concurrent access problems

Bug #248289 reported by ExtraHop Networks on 2008-07-14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Jelmer Vernooij
Bazaar Subversion Plugin
Jelmer Vernooij

Bug Description

There appear to be problems with bzr-svn and concurrent access. If another checkin occurs while the user is typing a commit message in the editor, bzr-svn will overwrite the other checkin rather than fail with an out-of-date error. The out-of-date check seems to occur before the editor is invoked, but not again afterwards.


* Create a test svn repository and project:
  $ svnadmin create /var/tmp/svn
  $ mkdir test
  $ echo "test file" > test/test.txt
  $ svn import -m "test project" test file:///var/tmp/svn/test

* Check out the svn project to a working directory:
  $ svn co file:///var/tmp/svn/test

* Create a bazaar repository and checkout the test project:
  $ bzr init-repo --rich-root-pack /var/tmp/bzr
  $ bzr co file:///var/tmp/svn/test /var/tmp/bzr/test

* Checkin a change from bazaar but remain in the editor:
  $ cd /var/tmp/bzr/test
  $ echo "change from bazaar" >> test.txt
  $ bzr commit

* Sneak in a change to the test project from another shell:
  $ echo "change from subversion" >> test.txt
  $ svn commit -m "change from subversion" test.txt

* Return to the editor in the bazaar session and complete the commit. Notice
  that there are no out-of-date complaints. The change from subversion is
  no longer present on HEAD and revision 2 is missing in the svn log.

We are using bzr 1.5 and bzr-svn 0.4.10 with the stock packages for
python and python-subversion from Ubuntu 8.04.

Related branches

nicholas a. evans (nevans) wrote :

I've also been experiencing this issue. I hadn't noticed it until just recently, and when I looked back through the logs, it first occurred for me six months ago (01/23/08), and it's also occured with bzr 1.5 and bzr-svn 0.4.10.

Jelmer Vernooij (jelmer) on 2008-07-28
Changed in bzr-svn:
assignee: nobody → jelmer
importance: Undecided → Medium
milestone: none → 0.4.12
status: New → Triaged
Jelmer Vernooij (jelmer) wrote :

The unfortunate thing is that subversion doesn't allow locking of directories; it does allow locking of files.

Jelmer Vernooij (jelmer) wrote :

This requires a fix in bzr first. In bzrlib.commit it should call something less generic than repository.fetch() followed by master_branch.set_last_revision() to pull the revision into the master branch.

CodyC (cody-casterline) wrote :

First, a note: Reproducing this bug is currently blocked by

Instead of acquiring a lock on a directory while a user writes a commit message (since SVN doesn't allow it), what about just moving the out-of-date check to happen after the user supplies the commit message? It's not foolproof, but it reduces the time between check & push, and the likelyhood of the above issue arising.

Jelmer Vernooij (jelmer) on 2008-11-11
Changed in bzr-svn:
importance: Medium → High
milestone: 0.4.12 → 0.4.16
Jelmer Vernooij (jelmer) wrote :

That would require changes in bzrlib as well. It also doesn't help with push.

Jelmer Vernooij (jelmer) wrote :

merged now

Changed in bzr-svn:
milestone: 0.4.16 → 0.5.3
status: Triaged → Fix Released
Changed in bzr:
assignee: nobody → jelmer
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers