At http://bzr.arbash-meinel.com/branches/bzr/1.11/303538_max_readv

------------------------------------------------------------
revno: 3877
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: John Arbash Meinel <[EMAIL PROTECTED]>
branch nick: 303538_max_readv
timestamp: Mon 2008-12-01 17:20:22 -0600
message:
  Fix bug #303538 by capping the max per-hunk read size at 100MB.
=== modified file 'NEWS'
--- a/NEWS      2008-12-01 18:40:08 +0000
+++ b/NEWS      2008-12-01 23:20:22 +0000
@@ -23,6 +23,11 @@
     * Give proper error message for diff with non-existent dotted revno.
       (Marius Kruger, #301969)
 
+    * ``Transport.readv()`` defaults to not reading more than 100MB in a
+      single array. Further ``RemoteTransport.readv`` sets this to 5MB to
+      work better with how it splits its requests.
+      (John Arbash Meinel, #303538)
+
   DOCUMENTATION:
 
   API CHANGES:

=== modified file 'bzrlib/transport/__init__.py'
--- a/bzrlib/transport/__init__.py      2008-11-07 18:10:32 +0000
+++ b/bzrlib/transport/__init__.py      2008-12-01 23:20:22 +0000
@@ -797,6 +797,10 @@
         cur = _CoalescedOffset(None, None, [])
         coalesced_offsets = []
 
+        if max_size <= 0:
+            # 'unlimited', but we actually take this to mean 100MB buffer limit
+            max_size = 100*1024*1024
+
         for start, size in offsets:
             end = start + size
             if (last_end is not None

=== modified file 'bzrlib/transport/remote.py'
--- a/bzrlib/transport/remote.py        2008-11-21 00:23:54 +0000
+++ b/bzrlib/transport/remote.py        2008-12-01 23:20:22 +0000
@@ -323,7 +323,8 @@
         sorted_offsets = sorted(offsets)
         coalesced = list(self._coalesce_offsets(sorted_offsets,
                                limit=self._max_readv_combine,
-                               fudge_factor=self._bytes_to_read_before_seek))
+                               fudge_factor=self._bytes_to_read_before_seek,
+                               max_size=self._max_readv_bytes))
 
         # now that we've coallesced things, avoid making enormous requests
         requests = []

-- 
bazaar-commits mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/bazaar-commits

Reply via email to