aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@kernel.crashing.org>2023-03-09 16:52:20 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-03-11 20:49:18 +0000
commit6041b34740deee09ea65d705702555456a5e05d8 (patch)
treedbf9d660df486793ee2c873b5123cd7bc10d94aa
parente859ce61a7422425960342a47785468cef49caa1 (diff)
downloadbitbake-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.py8
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