Merge lp:~mbp/bzr/2.0-498378-peek-lock into lp:bzr/2.0

Proposed by Martin Pool
Status: Merged
Approved by: John A Meinel
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~mbp/bzr/2.0-498378-peek-lock
Merge into: lp:bzr/2.0
Diff against target: 34 lines (+11/-0)
2 files modified
NEWS (+3/-0)
bzrlib/lockdir.py (+8/-0)
To merge this branch: bzr merge lp:~mbp/bzr/2.0-498378-peek-lock
Reviewer Review Type Date Requested Status
John A Meinel Approve
Review via email: mp+16414@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Martin Pool (mbp) wrote :

This won't fix the actual underlying problem of bug 498378 but it will give a clearer message.

Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Pool wrote:
> Martin Pool has proposed merging lp:~mbp/bzr/2.0-498378-peek-lock into lp:bzr/2.0.
>
> Requested reviews:
> bzr-core (bzr-core)
>
>
> This won't fix the actual underlying problem of bug 498378 but it will give a clearer message.
>

 review: approve
 merge: approve

I wonder if you could have a simple test that monkeypatched .peek() or
deleted the info file at the appropriate time, etc. (Or a child class
that inherits from LockDir and overrides peek to return None.)

Anyway, this is still better than what we have.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAksvixUACgkQJdeBCYSNAAM8KACfYZNtbyyFy/x4RIZqV53MMXW+
PzcAnjREVIRkbEinlWXOfFSwcv1aKKXX
=gr/E
-----END PGP SIGNATURE-----

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

2009/12/22 John A Meinel <email address hidden>:
> I wonder if you could have a simple test that monkeypatched .peek() or
> deleted the info file at the appropriate time, etc. (Or a child class
> that inherits from LockDir and overrides peek to return None.)

You could, but I don't think it would be a good use of time to write it.

--
Martin <http://launchpad.net/~mbp/>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NEWS'
2--- NEWS 2009-12-21 16:45:39 +0000
3+++ NEWS 2009-12-22 04:12:17 +0000
4@@ -31,6 +31,9 @@
5 This will likely have an impact on any other process that is serving for
6 an extended period of time. (John Arbash Meinel, #494406)
7
8+* Give a clearer message if the lockdir disappears after being apparently
9+ successfully taken. (Martin Pool, #498378)
10+
11 * The 2a format wasn't properly restarting autopacks when something
12 changed underneath it (like another autopack). Now concurrent
13 autopackers will properly succeed. (John Arbash Meinel, #495000)
14
15=== modified file 'bzrlib/lockdir.py'
16--- bzrlib/lockdir.py 2009-07-27 05:24:02 +0000
17+++ bzrlib/lockdir.py 2009-12-22 04:12:17 +0000
18@@ -240,8 +240,16 @@
19 # incorrect. It's possible some other servers or filesystems will
20 # have a similar bug allowing someone to think they got the lock
21 # when it's already held.
22+ #
23+ # See <https://bugs.edge.launchpad.net/bzr/+bug/498378> for one case.
24+ #
25+ # Strictly the check is unnecessary and a waste of time for most
26+ # people, but probably worth trapping if something is wrong.
27 info = self.peek()
28 self._trace("after locking, info=%r", info)
29+ if info is None:
30+ raise LockFailed(self, "lock was renamed into place, but "
31+ "now is missing!")
32 if info['nonce'] != self.nonce:
33 self._trace("rename succeeded, "
34 "but lock is still held by someone else")

Subscribers

People subscribed via source and target branches