[oe-commits] [bitbake] 04/05: fetch2/wget: attempt checkstatus again if it fails

git at git.openembedded.org git at git.openembedded.org
Thu May 18 12:14:58 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch 1.30
in repository bitbake.

commit 0b48acbf0428975e67012877417b9f90d3e1778c
Author: Ross Burton <ross.burton at intel.com>
AuthorDate: Thu Jun 30 22:32:24 2016 +0100

    fetch2/wget: attempt checkstatus again if it fails
    
    Some services such as SourceForge seem to struggle to keep up under load, with
    the result that over half of the autobuilder checkuri runs fail with
    sourceforge.net "connection timed out".
    
    Attempt to mitigate this by re-attempting once the network operation on failure.
    
    (Bitbake rev: 54b1961551511948e0cbd2ac39f19b39b9cee568)
    
    Signed-off-by: Ross Burton <ross.burton at intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
    
    Hand applied
    Signed-off-by: Armin Kuster <akuster808 at gmail.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/fetch2/wget.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/lib/bb/fetch2/wget.py b/lib/bb/fetch2/wget.py
index 8bc9e93..691942c 100644
--- a/lib/bb/fetch2/wget.py
+++ b/lib/bb/fetch2/wget.py
@@ -104,7 +104,7 @@ class Wget(FetchMethod):
 
         return True
 
-    def checkstatus(self, fetch, ud, d):
+    def checkstatus(self, fetch, ud, d, try_again=True):
         import urllib2, socket, httplib
         from urllib import addinfourl
         from bb.fetch2 import FetchConnectionCache
@@ -278,9 +278,13 @@ class Wget(FetchMethod):
             r.get_method = lambda: "HEAD"
             opener.open(r)
         except urllib2.URLError as e:
-            # debug for now to avoid spamming the logs in e.g. remote sstate searches
-            logger.debug(2, "checkstatus() urlopen failed: %s" % e)
-            return False
+            if try_again:
+                logger.debug(2, "checkstatus: trying again")
+                return self.checkstatus(fetch, ud, d, False)
+            else:
+                # debug for now to avoid spamming the logs in e.g. remote sstate searches
+                logger.debug(2, "checkstatus() urlopen failed: %s" % e)
+                return False
         return True
 
     def _parse_path(self, regex, s):

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list