Merge lp:~jameinel/bzr/2.1-client-stream-started-819604 into lp:bzr/2.1
Status: | Work in progress |
---|---|
Proposed branch: | lp:~jameinel/bzr/2.1-client-stream-started-819604 |
Merge into: | lp:bzr/2.1 |
Prerequisite: | lp:~jameinel/bzr/2.1-client-reconnect-819604 |
Diff against target: |
175 lines (+90/-9) 4 files modified
bzrlib/smart/client.py (+5/-1) bzrlib/smart/medium.py (+1/-2) bzrlib/smart/protocol.py (+5/-0) bzrlib/tests/test_smart_transport.py (+79/-6) |
To merge this branch: | bzr merge lp:~jameinel/bzr/2.1-client-stream-started-819604 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
bzr-core | Pending | ||
Review via email: mp+78631@code.launchpad.net |
Commit message
Bug #819604, allow reconnecting with a body stream as long as we haven't touched the stream yet.
Description of the change
This layers on top of my 'client reconnect' patch for the case where we have a body stream.
1) It adds a flush just before we process the first entry of the body stream. This adds an extra write call to 'bzr push'. However, we write after every entry in the stream, and the first entry of the stream is actually very small. (bzrlib.
I don't imagine writing out the ProtocolThree headers will be adding tons of real world overhead.
2) It tracks once we start consuming body_stream, so that we don't do the auto-retry after that point.
I felt it was clear and clean enough to do it this way. We could arguably do a little bit better higher up the stack, but not much, as I described in the bug. Specifically, RemoteRepositor
[Just a comment, not a full review]
> 1) It adds a flush just before we process the first entry of the body repository. _stream_ to_byte_ stream( ) the begin() ', which is just
> stream. This adds an extra write call to 'bzr push'. However, we write
> after every entry in the stream, and the first entry of the stream is
> actually very small. (bzrlib.
> first object that gets flushed is 'pack_writer.
> the pack header.)
> I don't imagine writing out the ProtocolThree headers will be adding
> tons of real world overhead.
You may be right, but please check. Use the netem stuff under linux to
add latency to loopback (I like 500ms), it's documented on the wiki, and
try some pushes with and without.
> 2) It tracks once we start consuming body_stream, so that we don't do
> the auto-retry after that point.
>
> I felt it was clear and clean enough to do it this way. We could
The layering here sounds reasonable to me.
-Andrew.