Locks acquired via the smart protocol have poor lock info.

Bug #141157 reported by Andrew Bennetts
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned
Breezy
Triaged
Low
Unassigned
Launchpad itself
Triaged
Low
Unassigned

Bug Description

When you lock a branch or repository via the smart protocol (e.g. over bzr://), the lock info in the lock has no information about the client that took the lock, because at the moment the lock info is generated entirely by the server with no input from the client.

This causes unhelpful messages when there's lock contention, or a stale lock, i.e. "Unable to take lock XXX held by bzr-service@server" rather than "... held by bob@his-laptop".

This particularly affects the bzr+ssh://bazaar.launchpad.net/ hosting service. It would also affect anyone using a shared SSH account for multiple bzr users.

The Branch.lock_write and Repository.lock_write requests (or replacements for them) should allow the client to send some lock info to use, so the server include that in the lock info.

Revision history for this message
Andrew Bennetts (spiv) wrote :

A possible alternative solution for bzr+ssh://bazaar.launchpad.net/ specifically would be to teach that server to use the username (or user id) from the SSH authentication rather than "supermirror@vostok" when generating a lock info file. This might be a good idea anyway, for dealing gracefully with older clients that don't have this fix.

Revision history for this message
Andrew Bennetts (spiv) wrote :

Is this a duplicate of bug #125420 (or vice versa)?

Revision history for this message
Tim Penhey (thumper) wrote :

jml and thumper to look at during the Oct sprint

Revision history for this message
James Henstridge (jamesh) wrote :

I guess they are related. For bug 125420, we can improve matters in the short term by setting $BZR_EMAIL which probably clears up the confusion problem mentioned there.

That said, it would be good to get this problem properly fixed so that the client can send lock info, which is what this bug is about.

Revision history for this message
Tim Penhey (thumper) wrote :

We are able to set the launchpad codehosting service to show "<email address hidden>" instead of "supermirror@vostok". While it isn't ideal, it is better.

Changed in launchpad-bazaar:
assignee: nobody → thumper
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
David Allouche (ddaa) wrote :

I think writing "${lpuser}@bazaar.launchpad.net" in the lock would be confusing.

Normally, the bzr committer id includes a REAL user-provided email address that can be used to contact a human. We should not generate fake email addresses like this.

We should use the "${user.displayname} <${user.prefferred_email}>" if the email is public to authed users on the website, or use "${user.displayname] (${user.name})" or, if it exists, use some @launchpad.net email alias that redirects to the preferred of the user.

Revision history for this message
Tim Penhey (thumper) wrote :

Keeping the bug open and pushing out until a complete solution is available.

Changed in launchpad-bazaar:
milestone: 1.1.10 → 1.1.12
Tim Penhey (thumper)
Changed in launchpad-bazaar:
milestone: 1.1.12 → 1.2.1
Tim Penhey (thumper)
Changed in launchpad-bazaar:
importance: Medium → Low
milestone: 1.2.1 → none
Martin Pool (mbp)
Changed in bzr:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
John Lenton (chipaca) wrote :

I understand (after talking with thumper) that this is related: a push to launchpad got interrupted (dropped connection) and the message after that was

$ bzr push
Using saved push location: bzr+ssh://<email address hidden>/~chipaca/xyzzy/blah
Unable to obtain lock lp-46717904:///~chipaca/xyzzy/blah/.bzr/branch/lock
held by <email address hidden> on host crowberry [process #10729]
locked 9 hours, 30 minutes ago
Will continue to try until 11:36:49, unless you press Ctrl-C
If you're sure that it's not being modified, use bzr break-lock lp-46717904:///~chipaca/xyzzy/blah/.bzr/branch/lock
bzr: ERROR: Could not acquire lock "(remote lock)"

doing bzr break lock lp-46717904:///... didn't work; I had to remove both the -<number> and the ///.

Revision history for this message
Jonathan Lange (jml) wrote :

This isn't really in progress anymore.

Bug 128824 has the same root cause: we don't translate paths back to virtual paths when we raise errors.

Changed in launchpad-bazaar:
assignee: thumper → nobody
status: In Progress → Triaged
Revision history for this message
Jonathan Lange (jml) wrote :

Separately from the path translation, the other remaining issue in this bug is that neither Launchpad nor Bazaar attempt to store the client's host information in the lock info.

Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
Jelmer Vernooij (jelmer)
tags: removed: check-for-breezy
Changed in brz:
status: New → Triaged
importance: Undecided → Low
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.