Re: [bitbake-devel] [PATCH v2] cooker: limit the execution of the hashequiv client/server ping

"Mathieu Dubois-Briand" <[email protected]>
Newsgroups org.openembedded.lists.bitbake-devel
Message-ID <[email protected]>
On Tue May 5, 2026 at 6:05 PM CEST, Corentin Guillevic via lists.openembedded.org wrote:
> From: Corentin Guillevic <[email protected]>
>
> The ping method is used to test the connection to the hash equivalence server.
> However, if the server is unavailable, the bitbake server has to wait several
> minutes for the system to terminate.
>
> While waiting for a response from the hash server, the bitbake server does not
> provide any feedback to the bitbake client. The latter then closes the link and
> fails with the error:
>
> Timeout while waiting for a reply from the bitbake server (60s at 09:50:15.377337)
>
> Adding a timeout to the ping step allows quicker action when a remote server is
> unavailable, and prevents disconnection of the client due to timeout.
> The default timeout is 10 seconds, but this can be set using the
> BB_HASHSERVE_UPSTREAM_TIMEOUT variable.
>
> Signed-off-by: Corentin Guillevic <[email protected]>
> ---

Hi Corentin,

Thanks for the new version.

> --- a/lib/bb/cooker.py
> +++ b/lib/bb/cooker.py
> @@ -342,7 +342,7 @@ according to https://docs.yoctoproject.org/dev-manual/hashequivserver.html""".fo
>                  if upstream:
>                      try:
>                          with hashserv.create_client(upstream) as client:
> -                            client.ping()
> +                            client.ping(int(self.data.getVar("BB_HASHSERVE_UPSTREAM_TIMEOUT")) or 10)

I believe this is not sufficient when BB_HASHSERVE_UPSTREAM_TIMEOUT is
not defined:

TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'

https://autobuilder.yoctoproject.org/valkyrie/#/builders/80/builds/3542

Maybe this is just a parenthesis issue?
client.ping(int(self.data.getVar("BB_HASHSERVE_UPSTREAM_TIMEOUT") or 10))

Thanks,
Mathieu

-- 
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.