[yum-commits] yum/yumRepo.py

zpavlas at osuosl.org zpavlas at osuosl.org
Tue Nov 5 10:06:44 UTC 2013


 yum/yumRepo.py |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit ad9eb71cc910a67c02985e963afb19e3721f0e96
Author: Zdenek Pavlas <zpavlas at redhat.com>
Date:   Fri Oct 25 11:27:17 2013 +0200

    Same-mirror retry on refused connections. Helps BZ 853432
    
    "Connection refused" is usually caused by server being administratively
    down. However, the connection might also be closed by a conn-limiting
    firewall. RST is also sent by kernel when the listening socket's accept()
    queue is full.
    
    Both causes are transient, so maybe it's worth retrying. When this
    assumption is wrong, there's little harm done. Timeouts are much worse,
    and we already retry on timeouts.

diff --git a/yum/yumRepo.py b/yum/yumRepo.py
index e371676..67bb7c9 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -631,9 +631,10 @@ class YumRepository(Repository, config.RepoConf):
         def mirror_failure(obj):
             action = {}
 
-            # timeouts and 503 errors may retry
+            # timeout, refused connect, and HTTP 503 may retry
             e = obj.exception
-            if e.errno == 12 or getattr(e, 'code', 0) == 503:
+            if e.errno == 12 or \
+               e.errno == 14 and getattr(e, 'code', 0) in (7, 503):
                 tries = getattr(obj, 'tries', self.retries)
                 if tries <= self.retries - len(self.urls):
                     # don't remove this mirror yet


More information about the Yum-commits mailing list