summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-11-10 14:45:26 -1000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-11-11 11:04:19 +0000
commitc8229eae5c06b1c9a7ded19b302c0a560c526d8f (patch)
treed8f516a63a3021ada494a2f8cc01596f055554bc
parentc40ac16d79026169639f47be76a3f7b9d8b5178e (diff)
downloadpoky-c8229eae5c06b1c9a7ded19b302c0a560c526d8f.tar.gz
bitbake: fetch/wget: Add timeout for checkstatus calls (30s)
We had an issue where a webserver serving sstate had filesystem issues so would accept connections but effectively not do anything with them. This causes bitbake to hang whilst processing things like sstate objects inside the checkstatus() calls. It can be replicated by setting up a server like: socat -u TCP4-LISTEN:NNN,fork OPEN:/dev/null and pointing SSTATE_MIRRORS in OE at that address. Adding a timeout to the checkstatus calls of 30s means that whilst the system will pause, it will then continue and not hang entirely. Since there isn't a large transfer here, 30s should be a reasonable response time after which we should fall back to building things ourselves. [YOCTO #13716] (Bitbake rev: bf59c0080763e8d03f75fe130ae9708e572391f3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/fetch2/wget.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/bitbake/lib/bb/fetch2/wget.py b/bitbake/lib/bb/fetch2/wget.py
index 784df70c9f..7fa2a87ffd 100644
--- a/bitbake/lib/bb/fetch2/wget.py
+++ b/bitbake/lib/bb/fetch2/wget.py
@@ -322,7 +322,7 @@ class Wget(FetchMethod):
322 except (TypeError, ImportError, IOError, netrc.NetrcParseError): 322 except (TypeError, ImportError, IOError, netrc.NetrcParseError):
323 pass 323 pass
324 324
325 with opener.open(r) as response: 325 with opener.open(r, timeout=30) as response:
326 pass 326 pass
327 except urllib.error.URLError as e: 327 except urllib.error.URLError as e:
328 if try_again: 328 if try_again: