concurrent access problems

Bug #248289 reported by ExtraHop Networks
28
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Undecided
Jelmer Vernooij
Bazaar Subversion Plugin
Fix Released
High
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.

Repro:

* 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

Revision history for this message
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)
Changed in bzr-svn:
assignee: nobody → jelmer
importance: Undecided → Medium
milestone: none → 0.4.12
status: New → Triaged
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

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

Revision history for this message
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.

Revision history for this message
CodyC (cody-casterline) wrote :

First, a note: Reproducing this bug is currently blocked by https://bugs.launchpad.net/bzr/+bug/293440

Second:
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)
Changed in bzr-svn:
importance: Medium → High
milestone: 0.4.12 → 0.4.16
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

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

Revision history for this message
Jelmer Vernooij (jelmer) wrote :
Revision history for this message
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  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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