Rev 4913: Use the raw _send_no_retry when retrying from a read. in http://bazaar.launchpad.net/~jameinel/bzr/2.1-client-read-reconnect-819604

John Arbash Meinel john at arbash-meinel.com
Mon Oct 10 13:04:49 UTC 2011


At http://bazaar.launchpad.net/~jameinel/bzr/2.1-client-read-reconnect-819604

------------------------------------------------------------
revno: 4913
revision-id: john at arbash-meinel.com-20111010130431-ha7o9x3fgau1hry1
parent: john at arbash-meinel.com-20111010130028-qvl0xb9skvpe0bja
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.1-client-read-reconnect-819604
timestamp: Mon 2011-10-10 15:04:31 +0200
message:
  Use the raw _send_no_retry when retrying from a read.
  
  That way we don't chain these retry requests. Otherwise the max retries would be:
  1) first write fails, we reconnect, and then the write succeeds.
  2) reading the response fails, so we reconnect
  3) Then the first write fails, so we reconnect
  
  We really only remove (3), but it seems worthy to get rid of.
-------------- next part --------------
=== modified file 'bzrlib/smart/client.py'
--- a/bzrlib/smart/client.py	2011-10-10 13:00:28 +0000
+++ b/bzrlib/smart/client.py	2011-10-10 13:04:31 +0000
@@ -195,7 +195,9 @@
             trace.warning('ConnectionReset reading response for %r, retrying'
                           % (self.method,))
             trace.log_exception_quietly()
-            response_handler = self._send(protocol_version)
+            encoder, response_handler = self._construct_protocol(
+                protocol_version)
+            self._send_no_retry(encoder)
             response_tuple = response_handler.read_response_tuple(
                 expect_body=self.expect_response_body)
         return (response_tuple, response_handler)



More information about the bazaar-commits mailing list