can't run bzr info while dirstate is locked

Bug #174055 reported by Martin Pool
2
Affects Status Importance Assigned to Milestone
Bazaar
In Progress
Low
Robert Collins

Bug Description

% bzr info

bzr: ERROR: Could not acquire lock "[Errno 11] Resource temporarily unavailable"
/home/mbp/repo/bzr.1.0/bzrlib/lock.py:79: UserWarning: lock on <open file u'/home/mbp/bzr/trunk/.bzr/checkout/dirstate', mode 'rb' at 0x84e7890> not released
  warn("lock on %r not released" % self.f)

Related branches

Martin Pool (mbp)
Changed in bzr:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Aaron Bentley (abentley) wrote :

This seems like it should be combined with 98836, perhaps titled "can't do readonly operations while dirstate is locked"

Revision history for this message
Martin Pool (mbp) wrote :

I guess it depends how we fix bug 98836 - if we just make locks transparent to readers, this will implicitly be fixed. If we keep dirstate read locks then I think info should still be able to pass (even if nothing else can work on the working directory.) And we should be able to read things that can't change, like the format. (I think that's protected by the bzrdir lock.)

Revision history for this message
Alexander Belchenko (bialix) wrote :

I reported about this many times in the list and even file the bug report month ago: https://bugs.launchpad.net/bzr/+bug/158596

Here the changes to test suite to reveal the problem on Linux:

=== modified file 'bzrlib/tests/blackbox/test_info.py'
--- bzrlib/tests/blackbox/test_info.py 25.10.2007 7:57:32
+++ bzrlib/tests/blackbox/test_info.py 30.10.2007 12:15:11
@@ -1136,12 +1136,15 @@
             except errors.PathNotChild:
                 return path

- if tree_locked and sys.platform == 'win32':
- # We expect this to fail because of locking errors. (A write-locked
- # file cannot be read-locked in the same process).
+ if tree_locked:
+ # We expect this to fail because of locking errors.
+ # (A write-locked file cannot be read-locked
+ # in the different process -- either on win32 or on linux).
             # This should be removed when the locking errors are fixed.
- self.run_bzr_error([], 'info ' + command_string)
- return
+ self.expectFailure('OS locks are exclusive '
+ 'for different processes (Bug #158596)',
+ self.run_bzr_subprocess,
+ 'info ' + command_string)
         out, err = self.run_bzr('info %s' % command_string)
         description = {
             (True, True): 'Lightweight checkout',

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 174055] Re: can't run bzr info while dirstate is locked

On Dec 5, 2007 5:52 PM, Alexander Belchenko <email address hidden> wrote:
> I reported about this many times in the list and even file the bug
> report month ago: https://bugs.launchpad.net/bzr/+bug/158596
>
> Here the changes to test suite to reveal the problem on Linux:
>
> === modified file 'bzrlib/tests/blackbox/test_info.py'
> --- bzrlib/tests/blackbox/test_info.py 25.10.2007 7:57:32
> +++ bzrlib/tests/blackbox/test_info.py 30.10.2007 12:15:11
> @@ -1136,12 +1136,15 @@
> except errors.PathNotChild:
> return path
>
> - if tree_locked and sys.platform == 'win32':
> - # We expect this to fail because of locking errors. (A write-locked
> - # file cannot be read-locked in the same process).
> + if tree_locked:
> + # We expect this to fail because of locking errors.
> + # (A write-locked file cannot be read-locked
> + # in the different process -- either on win32 or on linux).
> # This should be removed when the locking errors are fixed.
> - self.run_bzr_error([], 'info ' + command_string)
> - return
> + self.expectFailure('OS locks are exclusive '
> + 'for different processes (Bug #158596)',
> + self.run_bzr_subprocess,
> + 'info ' + command_string)
> out, err = self.run_bzr('info %s' % command_string)
> description = {
> (True, True): 'Lightweight checkout',

+1, go ahead and merge

--
Martin

tags: added: dirstate2
Revision history for this message
Robert Collins (lifeless) wrote :

Works in my dirstate2 branch with --development-rich-root.

NOT suitable for dogfooding yet, but works for doing experiments with in throw-away checkouts.

Changed in bzr:
assignee: nobody → Robert Collins (lifeless)
status: Confirmed → In Progress
Revision history for this message
travers (traverscug) wrote :

How to fix this problem?

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.