Lower the timeout to 9 sec to reduce delays.
authorCameron Dale <camrdale@gmail.com>
Sat, 3 May 2008 17:21:38 +0000 (10:21 -0700)
committerCameron Dale <camrdale@gmail.com>
Sat, 3 May 2008 17:21:38 +0000 (10:21 -0700)
apt-p2p.conf
apt_p2p/apt_p2p_conf.py
apt_p2p_Khashmir/DHT.py
apt_p2p_Khashmir/khashmir.py
apt_p2p_Khashmir/krpc.py
debian/apt-p2p.conf.sgml
test.py

index e3512c8e80491d6c208112056426a9c0e2fb30ee..1031d1ea2c72126f1f773c18ba83f071c8288733 100644 (file)
@@ -114,14 +114,14 @@ BUCKET_STALENESS = 1h
 KEY_EXPIRE = 3h
 
 # Timeout KRPC requests to nodes after this time.
-KRPC_TIMEOUT = 14s
+KRPC_TIMEOUT = 9s
 
 # KRPC requests are resent using exponential backoff starting with this delay.
 # The request will first be resent after the delay set here.
 # The request will be resent again after twice the delay set here. etc.
-# e.g. if TIMEOUT is 14 sec., and INITIAL_DELAY is 2 sec., then requests will
+# e.g. if TIMEOUT is 9 sec., and INITIAL_DELAY is 2 sec., then requests will
 # be resent at times 0, 2 (2 sec. later), and 6 (4 sec. later), and then will
-# timeout at 14.
+# timeout at 9.
 KRPC_INITIAL_DELAY = 2s
 
 # whether to spew info about the requests/responses in the protocol
index de7cc60aea95e225c99d87bb505e171df8545038..169a60b4882309250af71936ec225e030970b07a 100644 (file)
@@ -124,14 +124,14 @@ DHT_DEFAULTS = {
     'KEY_EXPIRE': '3h', # 3 hours
     
     # Timeout KRPC requests to nodes after this time.
-    'KRPC_TIMEOUT': '14s',
+    'KRPC_TIMEOUT': '9s',
     
     # KRPC requests are resent using exponential backoff starting with this delay.
     # The request will first be resent after the delay set here.
     # The request will be resent again after twice the delay set here. etc.
-    # e.g. if TIMEOUT is 14 sec., and INITIAL_DELAY is 2 sec., then requests will
+    # e.g. if TIMEOUT is 9 sec., and INITIAL_DELAY is 2 sec., then requests will
     # be resent at times 0, 2 (2 sec. later), and 6 (4 sec. later), and then will
-    # timeout at 14.
+    # timeout at 9.
     'KRPC_INITIAL_DELAY': '2s',
 
     # whether to spew info about the requests/responses in the protocol
index cc3660c5679149e78e68447cacb3ab3f13418234..af247302f9ed6dc0b3838bbef09d2ebf681d54f8 100644 (file)
@@ -337,7 +337,7 @@ class TestSimpleDHT(unittest.TestCase):
                     'STORE_REDUNDANCY': 3, 'RETRIEVE_VALUES': -10000,
                     'MAX_FAILURES': 3, 'LOCAL_OK': True,
                     'MIN_PING_INTERVAL': 900,'BUCKET_STALENESS': 3600,
-                    'KRPC_TIMEOUT': 14, 'KRPC_INITIAL_DELAY': 2,
+                    'KRPC_TIMEOUT': 9, 'KRPC_INITIAL_DELAY': 2,
                     'KEY_EXPIRE': 3600, 'SPEW': True, }
 
     def setUp(self):
@@ -458,7 +458,7 @@ class TestMultiDHT(unittest.TestCase):
                     'STORE_REDUNDANCY': 3, 'RETRIEVE_VALUES': -10000,
                     'MAX_FAILURES': 3, 'LOCAL_OK': True,
                     'MIN_PING_INTERVAL': 900,'BUCKET_STALENESS': 3600,
-                    'KRPC_TIMEOUT': 14, 'KRPC_INITIAL_DELAY': 2,
+                    'KRPC_TIMEOUT': 9, 'KRPC_INITIAL_DELAY': 2,
                     'KEY_EXPIRE': 3600, 'SPEW': True, }
 
     def setUp(self):
index 9509ce6bbff17e3a15fa4b4a3200ce9eb8bc7b7c..74263a6e5df019116c4948909e6efa21ad4dcbda 100644 (file)
@@ -563,7 +563,7 @@ class SimpleTests(unittest.TestCase):
                     'STORE_REDUNDANCY': 3, 'RETRIEVE_VALUES': -10000,
                     'MAX_FAILURES': 3, 'LOCAL_OK': True,
                     'MIN_PING_INTERVAL': 900,'BUCKET_STALENESS': 3600,
-                    'KRPC_TIMEOUT': 14, 'KRPC_INITIAL_DELAY': 2,
+                    'KRPC_TIMEOUT': 9, 'KRPC_INITIAL_DELAY': 2,
                     'KEY_EXPIRE': 3600, 'SPEW': True, }
 
     def setUp(self):
@@ -637,7 +637,7 @@ class MultiTest(unittest.TestCase):
                     'STORE_REDUNDANCY': 3, 'RETRIEVE_VALUES': -10000,
                     'MAX_FAILURES': 3, 'LOCAL_OK': True,
                     'MIN_PING_INTERVAL': 900,'BUCKET_STALENESS': 3600,
-                    'KRPC_TIMEOUT': 14, 'KRPC_INITIAL_DELAY': 2,
+                    'KRPC_TIMEOUT': 9, 'KRPC_INITIAL_DELAY': 2,
                     'KEY_EXPIRE': 3600, 'SPEW': True, }
 
     def _done(self, val):
index a2afac7db6303bd277680562649aa52e71672513..97186a0a36c9de1f33647d106b76d2082d1144d1 100644 (file)
@@ -253,7 +253,7 @@ class KrpcRequest(defer.Deferred):
         """Check for a unrecoverable timeout, otherwise resend."""
         self.later = None
         delay = datetime.now() - self.start
-        if delay > timedelta(seconds = self.config.get('KRPC_TIMEOUT', 14)):
+        if delay > timedelta(seconds = self.config.get('KRPC_TIMEOUT', 9)):
             log.msg('%r timed out after %0.2f sec' %
                     (self.tid, delay.seconds + delay.microseconds/1000000.0))
             self.protocol.timeOut(self.tid, self.method)
@@ -584,7 +584,7 @@ def make(port):
     from stats import StatsLogger
     af = Receiver()
     a = hostbroker(af, StatsLogger(None, None),
-                   {'KRPC_TIMEOUT': 14, 'KRPC_INITIAL_DELAY': 2, 'SPEW': False})
+                   {'KRPC_TIMEOUT': 9, 'KRPC_INITIAL_DELAY': 2, 'SPEW': False})
     a.protocol = KRPC
     p = reactor.listenUDP(port, a)
     return af, a, p
index cf10b44ab4e4e4b56d26a5164c4a5fdff36d8555..47d4547a619b9bed21202ad6561e125204e5a3e2 100644 (file)
            <term><option>KRPC_TIMEOUT = <replaceable>time</replaceable></option></term>
             <listitem>
              <para>The <replaceable>time</replaceable> to wait before KRPC requests timeout.
-                 (Default is 14 seconds.)</para>
+                 (Default is 9 seconds.)</para>
            </listitem>
          </varlistentry>
          <varlistentry>
              <para>The <replaceable>time</replaceable> to start with when resending KRPC requests using exponential backoff.
                  The request will first be resent after the delay set here.
                  The request will be resent again after twice the delay set here, and so on.
-                 e.g. if TIMEOUT is 14 sec., and INITIAL_DELAY is 2 sec., then requests will
+                 e.g. if TIMEOUT is 9 sec., and INITIAL_DELAY is 2 sec., then requests will
                  be resent at times 0, 2 (2 sec. later), and 6 (4 sec. later), and then will
-                 timeout at 14. (Default is 2 seconds.)</para>
+                 timeout at 9. (Default is 2 seconds.)</para>
            </listitem>
          </varlistentry>
          <varlistentry>
diff --git a/test.py b/test.py
index a04903c88f676a3e6276efbaaf4ddbb902b0cf29..1abbe3a5067ae1a302a15e08f9222441a6ea34a8 100755 (executable)
--- a/test.py
+++ b/test.py
@@ -522,14 +522,14 @@ LOCAL_OK = yes
 KEY_EXPIRE = 3h
 
 # Timeout KRPC requests to nodes after this time.
-KRPC_TIMEOUT = 14s
+KRPC_TIMEOUT = 9s
 
 # KRPC requests are resent using exponential backoff starting with this delay.
 # The request will first be resent after the delay set here.
 # The request will be resent again after twice the delay set here. etc.
-# e.g. if TIMEOUT is 14 sec., and INITIAL_DELAY is 2 sec., then requests will
+# e.g. if TIMEOUT is 9 sec., and INITIAL_DELAY is 2 sec., then requests will
 # be resent at times 0, 2 (2 sec. later), and 6 (4 sec. later), and then will
-# timeout at 14.
+# timeout at 9.
 KRPC_INITIAL_DELAY = 2s
 
 # whether to spew info about the requests/responses in the protocol