Cannot perform concurrent push to different branches in the same Subversion

Bug #258731 reported by Russel Winder
4
Affects Status Importance Assigned to Milestone
bzr-svn (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: bzr-svn

A Subversion repository comprises many branches whereas each Bazaar branch is independent -- obvious fact, but there are consequences. In particular, two Bazaar branches related to the same Subversion repository are data coupled in a way that is counter-intuitive -- the branches are independent and all local operations can be carried out concurrently, but any operations involving the Subversion repository must be serialized. Yet this is not obvious as the Bazaar branches are independent entities, the user has to remember that they are in fact associated with the same Subversion store.

Moreover the error message reported when a problem occurs is not the right error message, this is not a Bazaar failure except insofar that the error message is wrong and Bazaar should be dealing with this a lot better than it currently does. I propose that when a lock is encountered there is a message output and then the process backs off for a retry rather than just failing with a catastrophic error such as:

 Using saved location: svn+https://svn.codehaus.org/gant/gant/branches/1.4.x
The svn+ syntax is deprecated, use https://svn.codehaus.org/gant/gant/branches/1.4.x instead.
bzr: ERROR: sqlite3.OperationalError: database is locked

Traceback (most recent call last):
  File "/home/Checkouts/Bazaar/Bazaar_Mainline/bzrlib/commands.py", line 857, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/home/Checkouts/Bazaar/Bazaar_Mainline/bzrlib/commands.py", line 797, in run_bzr
    ret = run(*run_argv)
  File "/home/Checkouts/Bazaar/Bazaar_Mainline/bzrlib/commands.py", line 499, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/Checkouts/Bazaar/Bazaar_Mainline/bzrlib/builtins.py", line 802, in run
    use_existing_dir=use_existing_dir)
  File "/home/Checkouts/Bazaar/Bazaar_Mainline/bzrlib/push.py", line 172, in _show_push_branch
    stop_revision=revision_id)
  File "/home/Checkouts/Bazaar/Bazaar_Mainline/bzrlib/decorators.py", line 138, in read_locked
    result = unbound(self, *args, **kwargs)
  File "/home/Checkouts/Bazaar/Bazaar_Mainline/bzrlib/branch.py", line 1779, in push
    _override_hook_source_branch=_override_hook_source_branch)
  File "/home/Checkouts/Bazaar/Bazaar_Mainline/bzrlib/branch.py", line 1821, in _push_with_bound_branches
    result = self._basic_push(target, overwrite, stop_revision)
  File "/home/Checkouts/Bazaar/Bazaar_Mainline/bzrlib/branch.py", line 1838, in _basic_push
    result.old_revno, result.old_revid = target.last_revision_info()
  File "/home/users/russel/.bazaar/plugins/svn/branch.py", line 379, in last_revision_info
    last_revid = self.last_revision()
  File "/home/users/russel/.bazaar/plugins/svn/branch.py", line 434, in last_revision
    return self.generate_revision_id(self.get_revnum())
  File "/home/users/russel/.bazaar/plugins/svn/branch.py", line 313, in generate_revision_id
    revnum, self.get_branch_path(revnum), self.mapping)
  File "/home/users/russel/.bazaar/plugins/svn/repository.py", line 627, in generate_revision_id
    return self.get_revmap().get_revision_id(revnum, path, mapping, revprops, changed_fileprops)
  File "/home/users/russel/.bazaar/plugins/svn/revids.py", line 142, in get_revision_id
    self.cache.insert_revid(revid, path, revnum, revnum, str(mapping.scheme))
  File "/home/users/russel/.bazaar/plugins/svn/revids.py", line 309, in insert_revid
    (min_revnum, max_revnum, revid, branch, scheme))
OperationalError: database is locked

bzr 1.7dev on python 2.5.2 (linux2)
arguments: ['/home/users/russel/bin/bzr', 'push']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_GB.UTF-8'
plugins:
  builddeb /usr/lib/python2.5/site-packages/bzrlib/plugins/builddeb [0.92.0dev0]
  bzrtools /home/users/russel/.bazaar/plugins/bzrtools [1.6.0]
  email /home/users/russel/.bazaar/plugins/email [unknown]
  gtk /home/users/russel/.bazaar/plugins/gtk [0.96.0dev1]
  launchpad /home/Checkouts/Bazaar/Bazaar_Mainline/bzrlib/plugins/launchpad [unknown]
  pqm /usr/lib/python2.5/site-packages/bzrlib/plugins/pqm [1.0.0dev0]
  rebase /home/users/russel/.bazaar/plugins/rebase [0.4.0dev0]
  svn /home/users/russel/.bazaar/plugins/svn [0.4.11rc1]
  xmloutput /home/users/russel/.bazaar/plugins/xmloutput [0.4.5]
*** Bazaar has encountered an internal error.
    Please report a bug at https://bugs.launchpad.net/bzr/+filebug
    including this traceback, and a description of what you
    were doing when the error occurred.

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.