[MERGE] [BUG #165061] Force http.readv() to a maximum number of range requests.

John Arbash Meinel john at arbash-meinel.com
Mon Nov 26 22:58:43 GMT 2007


In: https://bugs.launchpad.net/bzr/+bug/165061
Robert noticed that when working with his pack branch, it actually ended
up downloading the same data multiple times.
It happened because with the first pull, it tried to split up the request
into to many sections, which triggered the 'issue 1 range for all readv()'
code path. And I believe there is a small pack issue about requesting a
piece at the beginning of the file, as well as all the signatures at the
end of the file.

Anyway, this patch should make Bazaar friendlier when trying to download a
large subset of a pack repository. If we were downloading the whole thing,
the ranges would collapse down into a single range.

Robert noticed that he was getting a collapse down into 671 ranges. This
code should force our requests to always be less than 200 ranges.

This code also has the advantage that it should only collapse nearby
ranges. So we don't end up putting the request at the beginning of the
file into the same request at the end of the file. Instead we keep
grouping the close-together changes.

It is inefficient in that it keeps retrying the collapse function with
larger fudge factors, but this code path should generally be triggered
rarely anyway.

John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/x-patch
Size: 8043 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20071126/246215d1/attachment.bin 


More information about the bazaar mailing list