Skip to contentSkip to conversation

[1.46][PATCH] fetch/wget: Add timeout for checkstatus calls (30s)

bitbake Steve Sakoman 2 participants 2 messages Nov 11, 2021 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

From: Richard Purdie <[email protected]>

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 15s 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]

---
 lib/bb/fetch2/wget.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/fetch2/wget.py +1 -1
index f7d1de26..5676d3fd 100644
@@ -319,7 +319,7 @@ class Wget(FetchMethod):
             except (TypeError, ImportError, IOError, netrc.NetrcParseError):
                 pass
 
-            with opener.open(r) as response:
+            with opener.open(r, timeout=30) as response:
                 pass
         except urllib.error.URLError as e:
             if try_again:
Signature · 1 line
2.25.1
#2 lore raw

Steve Sakoman <[email protected]> escreveu no dia quinta, 11/11/2021 à(s) 00:45:

Quoted 7 lines

From: Richard Purdie <[email protected]>

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:

Quoted 6 lines

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 15s means that whilst the

-15
+30

but if we need the commit as in master we can drop this typo

Quoted 40 lines

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]

---
 lib/bb/fetch2/wget.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/fetch2/wget.py +0 -0
index f7d1de26..5676d3fd 100644
@@ -319,7 +319,7 @@ class Wget(FetchMethod):
             except (TypeError, ImportError, IOError,

netrc.NetrcParseError):
pass

lib/bb/fetch2/wget.py +1 -2
-            with opener.open(r) as response:
+            with opener.open(r, timeout=30) as response:
                 pass
         except urllib.error.URLError as e:
             if try_again:
--

2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#12997):
https://lists.openembedded.org/g/bitbake-devel/message/12997
Mute This Topic: https://lists.openembedded.org/mt/86971891/5052612
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 3 lines
Best regards,

José Quaresma