Traceback: "database is locked" when attempting a checkout while one is already in operation

Bug #333935 reported by David Strauss
2
Affects Status Importance Assigned to Milestone
Bazaar Subversion Plugin
New
Undecided
Unassigned

Bug Description

Checking out from an svn repo to directory A causes a traceback if you try to check out from the same repo to unrelated directory B. bzr-svn should allow two concurrent, unrelated checkouts to happen simultaneously or at least fail with a friendly message. I'm using the Bazaar 1.12 package for OS X.

bzr: ERROR: sqlite3.OperationalError: database is locked

Traceback (most recent call last):
  File "/Library/Python/2.5/site-packages/bzrlib/commands.py", line 896, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/Library/Python/2.5/site-packages/bzrlib/commands.py", line 842, in run_bzr
    ret = run(*run_argv)
  File "/Library/Python/2.5/site-packages/bzrlib/commands.py", line 542, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/Library/Python/2.5/site-packages/bzrlib/builtins.py", line 1132, in run
    accelerator_tree, hardlink)
  File "/Library/Python/2.5/site-packages/bzrlib/plugins/svn/branch.py", line 264, in create_checkout
    hardlink=hardlink)
  File "/Library/Python/2.5/site-packages/bzrlib/plugins/svn/branch.py", line 209, in _create_heavyweight_checkout
    checkout_branch.pull(self, stop_revision=revision_id)
  File "/Library/Python/2.5/site-packages/bzrlib/decorators.py", line 192, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/Library/Python/2.5/site-packages/bzrlib/branch.py", line 2128, in pull
    _override_hook_target=_override_hook_target)
  File "/Library/Python/2.5/site-packages/bzrlib/decorators.py", line 192, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/Library/Python/2.5/site-packages/bzrlib/branch.py", line 1928, in pull
    graph=graph)
  File "/Library/Python/2.5/site-packages/bzrlib/decorators.py", line 192, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/Library/Python/2.5/site-packages/bzrlib/branch.py", line 673, in update_revisions
    other_revno, other_last_revision = other.last_revision_info()
  File "/Library/Python/2.5/site-packages/bzrlib/plugins/svn/branch.py", line 346, in last_revision_info
    last_revid = self.last_revision()
  File "/Library/Python/2.5/site-packages/bzrlib/plugins/svn/branch.py", line 396, in last_revision
    last_revmeta, mapping = self.last_revmeta()
  File "/Library/Python/2.5/site-packages/bzrlib/plugins/svn/branch.py", line 181, in last_revmeta
    for revmeta, mapping in self._revision_meta_history():
  File "/Library/Python/2.5/site-packages/bzrlib/plugins/svn/util.py", line 142, in next
    return self._next()
  File "/Library/Python/2.5/site-packages/bzrlib/plugins/svn/util.py", line 124, in _next
    ret = self._iterator.next()
  File "/Library/Python/2.5/site-packages/bzrlib/plugins/svn/repository.py", line 654, in _iter_reverse_revmeta_mapping_history
    revid = revmeta.get_revision_id(mapping)
  File "/Library/Python/2.5/site-packages/bzrlib/plugins/svn/revmeta.py", line 848, in get_revision_id
    self._update_cache(mapping)
  File "/Library/Python/2.5/site-packages/bzrlib/plugins/svn/revmeta.py", line 789, in _update_cache
    self.revnum, self.revnum, mapping.name)
  File "/Library/Python/2.5/site-packages/bzrlib/plugins/svn/revids.py", line 341, in insert_revid
    (min_revnum, max_revnum, revid, branch, mapping))
OperationalError: database is locked

bzr 1.12 on python 2.5.1 (darwin)
arguments: ['/usr/local/bin/bzr', 'co', 'svn+https://economist.unfuddle.com/svn/economist_druconomist/trunk']
encoding: 'UTF-8', fsenc: 'utf-8', lang: 'en_US.UTF-8'
plugins:
  bzrtools /Library/Python/2.5/site-packages/bzrlib/plugins/bzrtools [1.12]
  cvsps_import /Users/straussd/.bazaar/plugins/cvsps_import [unknown]
  email /Library/Python/2.5/site-packages/bzrlib/plugins/email [unknown]
  extmerge /Library/Python/2.5/site-packages/bzrlib/plugins/extmerge [unknown]
  launchpad /Library/Python/2.5/site-packages/bzrlib/plugins/launchpad [unknown]
  loom /Library/Python/2.5/site-packages/bzrlib/plugins/loom [1.4dev]
  netrc_credential_store /Library/Python/2.5/site-packages/bzrlib/plugins/netrc_credential_store [unknown]
  qbzr /Library/Python/2.5/site-packages/bzrlib/plugins/qbzr [0.9.8]
  rebase /Library/Python/2.5/site-packages/bzrlib/plugins/rebase [0.4dev]
  search /Library/Python/2.5/site-packages/bzrlib/plugins/search [1.7dev]
  svn /Library/Python/2.5/site-packages/bzrlib/plugins/svn [0.5.2]
  upload /Library/Python/2.5/site-packages/bzrlib/plugins/upload [0.1.1]
*** 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.

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 333935] [NEW] Traceback: "database is locked" when attempting a checkout while one is already in operation

  duplicate 185200
--
Jelmer Vernooij <email address hidden> - http://samba.org/~jelmer/
Jabber: <email address hidden>

Revision history for this message
David Strauss (davidstrauss) wrote :

This isn't really a duplicate. This report is about concurrent checkout operations failing. #185200 appears to be about failure to release the lock.

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 333935] Re: Traceback: "database is locked" when attempting a checkout while one is already in operation

On Tue, 2009-02-24 at 22:59 +0000, David Strauss wrote:
> *** This bug is a duplicate of bug 185200 ***
> https://bugs.launchpad.net/bugs/185200
>
> This isn't really a duplicate. This report is about concurrent checkout
> operations failing. #185200 appears to be about failure to release the
> lock.
Are you sure you're looking at the right bug report ? 185200 explicitly
mentions the exact same "database is locked" exception in the title,
summary and one of the comments.

--
Jelmer Vernooij <email address hidden> - http://samba.org/~jelmer/
Jabber: <email address hidden>

Revision history for this message
David Strauss (davidstrauss) wrote :

Yes, I'm sure I'm looking at the right bug. Same exception != same issue. This issue deals with concurrent checkouts, and it's clear why you would encounter such a locking issue there. But it's a design flaw: users should be able to have multiple checkouts running concurrently.

The other issue, in contrast, is about improper lock acquisition/release having nothing to do with concurrent operations.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

On Tue, 2009-02-24 at 23:29 +0000, David Strauss wrote:
> *** This bug is a duplicate of bug 185200 ***
> https://bugs.launchpad.net/bugs/185200
>
> Yes, I'm sure I'm looking at the right bug. Same exception != same
> issue. This issue deals with concurrent checkouts, and it's clear why
> you would encounter such a locking issue there. But it's a design flaw:
> users should be able to have multiple checkouts running concurrently.
>
> The other issue, in contrast, is about improper lock acquisition/release
> having nothing to do with concurrent operations.
The other issue is *not* about improper lock acquisition, it's about
concurrent checkouts; two bzr-svn processes trying to
 use the same sqlite database.

The other bug does include some unrelated "bzr selftest" the original
reporter though might've been related, but if you read the entire bug
description, you'll see it's the same problem.

Cheers,

Jelmer
--
Jelmer Vernooij <email address hidden> - http://samba.org/~jelmer/
Jabber: <email address hidden>

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.