diff options
author | Ross Burton <ross.burton@intel.com> | 2016-06-30 22:32:24 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-07-08 09:57:26 +0100 |
commit | 312f1a5e74151b75e8f5e0d941c37ecac019245d (patch) | |
tree | 202cbc6531a8f8a7240973ba585a5a6a41f75980 /bitbake/lib/bb | |
parent | 1bbd580a3718b45fb72bb70462df5294a171eb72 (diff) | |
download | poky-312f1a5e74151b75e8f5e0d941c37ecac019245d.tar.gz |
bitbake: 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@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r-- | bitbake/lib/bb/fetch2/wget.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/bitbake/lib/bb/fetch2/wget.py b/bitbake/lib/bb/fetch2/wget.py index d688fd9d02..6cb22aeee9 100644 --- a/bitbake/lib/bb/fetch2/wget.py +++ b/bitbake/lib/bb/fetch2/wget.py | |||
@@ -104,7 +104,7 @@ class Wget(FetchMethod): | |||
104 | 104 | ||
105 | return True | 105 | return True |
106 | 106 | ||
107 | def checkstatus(self, fetch, ud, d): | 107 | def checkstatus(self, fetch, ud, d, try_again=True): |
108 | import urllib.request, urllib.error, urllib.parse, socket, http.client | 108 | import urllib.request, urllib.error, urllib.parse, socket, http.client |
109 | from urllib.response import addinfourl | 109 | from urllib.response import addinfourl |
110 | from bb.fetch2 import FetchConnectionCache | 110 | from bb.fetch2 import FetchConnectionCache |
@@ -278,9 +278,13 @@ class Wget(FetchMethod): | |||
278 | r.get_method = lambda: "HEAD" | 278 | r.get_method = lambda: "HEAD" |
279 | opener.open(r) | 279 | opener.open(r) |
280 | except urllib.error.URLError as e: | 280 | except urllib.error.URLError as e: |
281 | # debug for now to avoid spamming the logs in e.g. remote sstate searches | 281 | if try_again: |
282 | logger.debug(2, "checkstatus() urlopen failed: %s" % e) | 282 | logger.debug(2, "checkstatus: trying again") |
283 | return False | 283 | return self.checkstatus(fetch, ud, d, False) |
284 | else: | ||
285 | # debug for now to avoid spamming the logs in e.g. remote sstate searches | ||
286 | logger.debug(2, "checkstatus() urlopen failed: %s" % e) | ||
287 | return False | ||
284 | return True | 288 | return True |
285 | 289 | ||
286 | def _parse_path(self, regex, s): | 290 | def _parse_path(self, regex, s): |