Merge lp://qastaging/~jameinel/bzr/2.1-client-read-reconnect-819604 into lp://qastaging/bzr/2.1

Proposed by John A Meinel
Status: Work in progress
Proposed branch: lp://qastaging/~jameinel/bzr/2.1-client-read-reconnect-819604
Merge into: lp://qastaging/bzr/2.1
Prerequisite: lp://qastaging/~jameinel/bzr/2.1-categorize-requests-819604
Diff against target: 138 lines (+79/-5)
3 files modified
NEWS (+5/-0)
bzrlib/smart/client.py (+36/-2)
bzrlib/tests/test_smart_transport.py (+38/-3)
To merge this branch: bzr merge lp://qastaging/~jameinel/bzr/2.1-client-read-reconnect-819604
Reviewer Review Type Date Requested Status
bzr-core Pending
Review via email: mp+78839@code.qastaging.launchpad.net

Commit message

Bug #819604, retry the request if we get ConnectionReset while reading as well.

Description of the change

This is the final step in the chain.

This adds the ability to retry the request if we get a ConnectionReset while reading the response from the server.

Note that this only retries the request while parsing the response header (ok, error, etc). Not while reading the actual body content. However, as mentioned in the beginning, that is the use case that we really care about. We are trying to allow the server to soft-disconnect us, in which case it shouldn't send any response at all.

(The other thing we could have done is upgraded the RPC to allow the server to send a 'reconnect' message, but that wouldn't have been compatible with older clients, especially since they wouldn't have been listening for that response at the end of a previous message, etc.)

Note that I've tested this by running bzr.dev on devpad, and using 'bzr branch bzr+ssh://...' and then while on devpad, running 'kill -SIGHUP PID' on whatever bzr is currently active. I wasn't able to actually stop the branch from finishing, even though I killed it in a few different places.

And the client appropriately reported that it got ConnectionReset but that it was going to try again.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches