Merge lp:~vila/udd/801776-drop-transport into lp:udd

Proposed by Vincent Ladeuil
Status: Merged
Merged at revision: 531
Proposed branch: lp:~vila/udd/801776-drop-transport
Merge into: lp:udd
Diff against target: 33 lines (+9/-13)
1 file modified
udd/icommon.py (+9/-13)
To merge this branch: bzr merge lp:~vila/udd/801776-drop-transport
Reviewer Review Type Date Requested Status
Martin Pool Approve
Review via email: mp+80190@code.launchpad.net

Description of the change

This makes refresh_possible_transports more robust.

The aim of refresh_possible_transports is to avoid reusing a transport going
stale because it hasn't been used recently and the server closed the
connection.

I've grepped the logs of all packages and the conclusion is that we missed a
bunch of cases where bzrlib raise an exception which really means the
transport is stale and we aborted the import instead of letting the caller
create a new connection.

The proposed version doesn't try to catch all valid exceptions, it logs them
for investigation (time will tell if it's really worth the effort) and just
drop the transport.

If nothing else, this patch will allow the chromium-browser to succeed.

To post a comment you must log in.
lp:~vila/udd/801776-drop-transport updated
532. By Vincent Ladeuil

Get rid of the superfluous try.

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

  vote approve

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'udd/icommon.py'
2--- udd/icommon.py 2011-10-21 14:17:18 +0000
3+++ udd/icommon.py 2011-10-24 10:18:24 +0000
4@@ -1650,20 +1650,16 @@
5 still_usable = []
6 for t in possible_transports:
7 try:
8- try:
9- t.has('file-that-does-not-exist')
10- except errors.PathError:
11- # bzrlib isn't supposed to raise this error, but it does.
12- pass
13- except errors.TooManyConcurrentRequests:
14- mutter(
15- "refresh_possible_transports encountered a smart "
16- "transport with outstanding request: %r", t)
17- except socket.error, e:
18- # connection has been timed out by the server perhaps.
19+ t.has('file-that-does-not-exist')
20+ except errors.TooManyConcurrentRequests:
21 mutter(
22- "refresh_possible_transports dropping stale transport %r (%s)",
23- t, e)
24+ "refresh_possible_transports encountered a smart "
25+ "transport with outstanding request: %r", t)
26+ except Exception, e:
27+ # Any other exception is logged for further investigation. But
28+ # whatever it is, the transport can't be reused so we dropt it.
29+ mutter("refresh_possible_transports dropping"
30+ " transport %r (%s)", t, e)
31 else:
32 still_usable.append(t)
33 possible_transports[:] = still_usable

Subscribers

People subscribed via source and target branches