All of lore.kernel.org
 help / color / mirror / Atom feed
* [bitbake][dunfell][1.46][PATCH] fetch/wget: Add timeout for checkstatus calls (30s)
       [not found] <cover.1636591465.git.steve@sakoman.com>
@ 2021-11-11  0:45 ` Steve Sakoman
  2021-11-11  9:56   ` [bitbake-devel] " Jose Quaresma
  0 siblings, 1 reply; 2+ messages in thread
From: Steve Sakoman @ 2021-11-11  0:45 UTC (permalink / raw)
  To: bitbake-devel

From: Richard Purdie <richard.purdie@linuxfoundation.org>

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]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 lib/bb/fetch2/wget.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/bb/fetch2/wget.py b/lib/bb/fetch2/wget.py
index f7d1de26..5676d3fd 100644
--- a/lib/bb/fetch2/wget.py
+++ b/lib/bb/fetch2/wget.py
@@ -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:
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [bitbake-devel] [bitbake][dunfell][1.46][PATCH] fetch/wget: Add timeout for checkstatus calls (30s)
  2021-11-11  0:45 ` [bitbake][dunfell][1.46][PATCH] fetch/wget: Add timeout for checkstatus calls (30s) Steve Sakoman
@ 2021-11-11  9:56   ` Jose Quaresma
  0 siblings, 0 replies; 2+ messages in thread
From: Jose Quaresma @ 2021-11-11  9:56 UTC (permalink / raw)
  To: Steve Sakoman; +Cc: bitbake-devel

[-- Attachment #1: Type: text/plain, Size: 2163 bytes --]

Steve Sakoman <steve@sakoman.com> escreveu no dia quinta, 11/11/2021 à(s)
00:45:

> From: Richard Purdie <richard.purdie@linuxfoundation.org>
>
> 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
>

-15
+30

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


> 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]
>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
>  lib/bb/fetch2/wget.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/bb/fetch2/wget.py b/lib/bb/fetch2/wget.py
> index f7d1de26..5676d3fd 100644
> --- a/lib/bb/fetch2/wget.py
> +++ b/lib/bb/fetch2/wget.py
> @@ -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:
> --
> 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: bitbake-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [
> quaresma.jose@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>

-- 
Best regards,

José Quaresma

[-- Attachment #2: Type: text/html, Size: 3522 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-11  9:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <cover.1636591465.git.steve@sakoman.com>
2021-11-11  0:45 ` [bitbake][dunfell][1.46][PATCH] fetch/wget: Add timeout for checkstatus calls (30s) Steve Sakoman
2021-11-11  9:56   ` [bitbake-devel] " Jose Quaresma

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.