[Yum-devel] [PATCH] same-mirror retry also on timeout. BZ 853432

Zdenek Pavlas zpavlas at redhat.com
Fri May 10 10:42:19 UTC 2013


We should be able to retry on timeouts, too.
Works around connection-limited ftpds, that
may block for too long.
---
 yum/yumRepo.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/yum/yumRepo.py b/yum/yumRepo.py
index 961717d..770dac2 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -632,8 +632,9 @@ class YumRepository(Repository, config.RepoConf):
         def mirror_failure(obj):
             action = {}
 
-            # special handling of 503 errors
-            if getattr(obj.exception, 'code', 0) == 503:
+            # timeouts and 503 errors may retry
+            e = obj.exception
+            if e.errno == 12 or getattr(e, 'code', 0) == 503:
                 tries = getattr(obj, 'tries', self.retries)
                 if tries <= self.retries - len(self.urls):
                     # don't remove this mirror yet
-- 
1.7.11.7



More information about the Yum-devel mailing list