[MERGE] Avoid unnecessary reconnections to old servers when the first HPSS is an error in the right protocol version.

Andrew Bennetts andrew at canonical.com
Fri May 30 05:45:06 BST 2008


This patch fixes a bug reported on IRC.  If this first HPSS reply is an error
reply in the protocol version we are expecting, then the protocol detection has
succeeded and does not need to be repeated, but in bzr.dev the exception
handling prevents this from working correctly.

This happens in practice with at least 'bzr pull URL': it first tries
to read the remote path as a file in case it is a bundle, but if it is a
directory (e.g. because it is a branch), then the server will reply with a
ReadError.

It's potentionally a very serious correctness fix too: we end up re-issuing a
request that the remote side has already received correctly.  In practice this
seems to be harmless because if it causes an error response it probably didn't
do anything interesting anyway, but it's good to make sure there's no room for
nasty surprises here.

There's a small amount of extra fluff in this patch to:

 - make test_smart_transport pass with "bzr -Dhpss selftest -E allow_debug", and
 - if -Dhpss is used, log a little more info about the protocol decoder's state
   when an unexpected connection close/EOF occurs.

-Andrew.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smart-protocol-detection-fix-3462.patch
Type: text/x-diff
Size: 7417 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080530/fc40dd75/attachment.bin 


More information about the bazaar mailing list