diff options
author | Mark Hatle <mark.hatle@kernel.crashing.org> | 2023-03-09 16:52:20 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-03-11 20:49:18 +0000 |
commit | 6041b34740deee09ea65d705702555456a5e05d8 (patch) | |
tree | dbf9d660df486793ee2c873b5123cd7bc10d94aa | |
parent | e859ce61a7422425960342a47785468cef49caa1 (diff) | |
download | bitbake-contrib-6041b34740deee09ea65d705702555456a5e05d8.tar.gz |
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.
Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-rw-r--r-- | lib/bb/fetch2/wget.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/bb/fetch2/wget.py b/lib/bb/fetch2/wget.py index 859b4f99e..927487a0b 100644 --- a/lib/bb/fetch2/wget.py +++ b/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 |