From f9b422152bdb40ed49e3310983faf7f5fe58b10d Mon Sep 17 00:00:00 2001 From: Mark Hatle Date: Thu, 9 Mar 2023 16:52:20 -0600 Subject: bitbake: wget.py: Add catch TimeoutError exception We've observed TimeoutError exceptions during the sstate-cache mirror fetch, it appears that due to the number of (invalid) files requested the remote side is eventually dropping the connection (not closing it) which can result in a TimeoutError exception being sent, while rate it is different from the urllib.error.URLError or ConnectionResetError. (Bitbake rev: 6041b34740deee09ea65d705702555456a5e05d8) Signed-off-by: Mark Hatle Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch2/wget.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'bitbake/lib/bb/fetch2/wget.py') diff --git a/bitbake/lib/bb/fetch2/wget.py b/bitbake/lib/bb/fetch2/wget.py index 859b4f99e2..927487a0b6 100644 --- a/bitbake/lib/bb/fetch2/wget.py +++ b/bitbake/lib/bb/fetch2/wget.py @@ -385,6 +385,14 @@ class Wget(FetchMethod): # debug for now to avoid spamming the logs in e.g. remote sstate searches logger.debug2("checkstatus() urlopen failed: %s" % e) return False + except TimeoutError as e: + if try_again: + logger.debug2("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.debug2("checkstatus() urlopen TimeoutError: %s" % e) + return False return True -- cgit v1.2.3-54-g00ecf