Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id CDC63C5475B for ; Wed, 6 Mar 2024 11:28:58 +0000 (UTC) Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by mx.groups.io with SMTP id smtpd.web10.9689.1709724533093428791 for ; Wed, 06 Mar 2024 03:28:53 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=dmvfdPxy; spf=pass (domain: bootlin.com, ip: 217.70.183.193, mailfrom: michael.opdenacker@bootlin.com) Received: by mail.gandi.net (Postfix) with ESMTPSA id 16B6D240003; Wed, 6 Mar 2024 11:28:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1709724531; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Q1uMl6GYMRALgd6iK/wsasBMpvAXodG+3wZmBXgDXkc=; b=dmvfdPxyhwlhxebH/L602CNP/JTNOhcH4SuAV+VSyTKxLr900zvkA7SoH+IEnlbDXaK+rQ DODfUMc3LymGccM9rnikb40SjmUdVc286+JBB1uTeKjwnchL9K98HvyGYXQ4XGn+3QODka EmX5kvCHPNQ4EmFJxT3oMjExEXbbA4fc35hJsYpoUQ5Zgc6STYpI28isDHlMKGZxWaCCGx kL2FocG+YdQwvB0tHSyTfUgXxQXRHy26Q9Kn74llIIHmP/xY4x554qoL5Nr3ThDuz0uK27 UNogeLVQaR1/W7AqddvePxvDJxPlplDOfYmpyI6JjH8q8yg+Q0ItuQZHU8e5Tg== Message-ID: Date: Wed, 6 Mar 2024 12:28:50 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: BitBake developer list Subject: Re: [bitbake-devel] bitbake: how to create a client to an asyncrpc server from another server? Content-Language: en-US To: Joshua Watt References: <17B9E3910B366E1C.13906@lists.openembedded.org> From: Michael Opdenacker Organization: Bootlin In-Reply-To: <17B9E3910B366E1C.13906@lists.openembedded.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-GND-Sasl: michael.opdenacker@bootlin.com List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 06 Mar 2024 11:28:58 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/15988 Hi Joshua On 3/5/24 at 15:09, Michael Opdenacker via lists.openembedded.org wrote: > Hi Joshua > > On 3/4/24 at 20:27, Joshua Watt wrote: >> Michael, >> >> Create an async client instead of a blocking client: >> >>    conn = client.PRAsyncClient() >> >> You'll want to do this anyway because you want to make async calls to >> the "upstream" server. If you use a blocking client it will block the >> entire server process during the call which means the server won't be >> able to process any other clients while waiting for a response. > > That was exactly what I needed, thanks! Now, the "upstream" server is > receiving the connections from my local server. The received requests > are still invalid (investigating) but this is already a nice leap > forward. Actually, I'm struggling to reproduce this, as the upstream server doesn't seem to receive connections any more. Anyway, I'm not sure what you're suggesting is what I want. The connection to the upstream server is attempted from the start() function of the PRServer class, which is synchronous, so a synchronous connection to the upstream server should be fine too, right? However, this makes we wonder whether the local server start is the best place to establish the connection to the upstream server. It may be better to attempt to establish the connection for each client, as the upstream server could be temporarily unavailable. This way, some clients will get a failure, but later other clients will succeed, when the upstream server is back. This would work without having to restart the local server. This looks like a better solution, right? Cheers Michael. -- Michael Opdenacker, Bootlin Embedded Linux and Kernel engineering https://bootlin.com