Browse Source

Wait 5 seconds between data retries

This also improves chutney success rates on slow machines.

And fix a typo.
teor (Tim Wilson-Brown) 8 years ago
parent
commit
2e665358be
2 changed files with 4 additions and 4 deletions
  1. 3 3
      lib/chutney/Traffic.py
  2. 1 1
      scripts/chutney_tests/verify.py

+ 3 - 3
lib/chutney/Traffic.py

@@ -292,11 +292,11 @@ class Source(Peer):
             debug("BUG: sent no bytes")
             self._sent_no_bytes += 1
             # We can't retry too fast, otherwise clients burn all their HSDirs
-            if self._sent_no_bytes >= 3:
-                print("Send no data %d times. Stalled." %
+            if self._sent_no_bytes >= 2:
+                print("Sent no data %d times. Stalled." %
                       (self._sent_no_bytes))
                 return -1
-            time.sleep(3)
+            time.sleep(5)
         self.outbuf = self.outbuf[n:]
         if self.state == self.CONNECTING_THROUGH_PROXY:
             return 1  # Keep us around.

+ 1 - 1
scripts/chutney_tests/verify.py

@@ -16,7 +16,7 @@ def run_test(network):
         status = _verify_traffic(network)
         # Avoid madly spewing output if we fail immediately each time
         if not status:
-            time.sleep(2)
+            time.sleep(5)
     print("Transmission: %s" % ("Success" if status else "Failure"))
     if not status:
         # TODO: allow the debug flag to be passed as an argument to