mbox series

[bitbake-devel,v2,00/10] hashserv: Pipeline Upstream Queries

Message ID 20260730183254.793698-1-JPEWhacker@gmail.com
Headers show
Series hashserv: Pipeline Upstream Queries | expand

Message

Joshua Watt July 30, 2026, 6:30 p.m. UTC
Adds a true asynchronous streaming API to the hash equivalence clients,
then uses that streaming API to pipeline requests to an upstream server.
This means that when a server wants to defer a request to an upstream,
it no longer has to wait for a complete round-trip API call. Instead, it
can use the faster streaming API to send the requests, and continue
processing other requests while a response inbound.

V2: Fixes several bugs related to when the connection between the client
and upstream server was disconnected, and added tests for them.


Joshua Watt (10):
  asyncrpc: Add Task Group
  asyncrpc: serv: Use Task Group
  asyncrpc: serv: Cancel all clients on server stop
  hashserv: tests: Improve test logging
  hashserv: client: Add asynchronous streaming API
  hashserv: server: Add queued streaming API
  hashserv: server: Use streaming and queue API for upstream unihash
    queries
  hashserv: server: Use streaming and queue API for upstream exist
    queries
  hashserv: tests: Add more upstream tests
  hashserv: tests: Add test for upstream pipelining

 bin/bitbake-hashclient       |   2 +-
 lib/bb/asyncrpc/__init__.py  |   1 +
 lib/bb/asyncrpc/serv.py      |  13 +-
 lib/bb/asyncrpc/taskgroup.py |  52 ++++++
 lib/hashserv/client.py       | 349 +++++++++++++++++++++++++++--------
 lib/hashserv/server.py       | 181 ++++++++++++++----
 lib/hashserv/tests.py        | 261 ++++++++++++++++++++++++--
 7 files changed, 723 insertions(+), 136 deletions(-)
 create mode 100644 lib/bb/asyncrpc/taskgroup.py

Comments

Michal Sieron July 31, 2026, 1:05 p.m. UTC | #1
Hi,

something is not working for me...

In the first run I got it stuck for an hour at:
WARNING: Error contacting Hash Equivalence Server unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 192 messages but only received 49
WARNING: Error contacting Hash Equivalence Server unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 115 messages but only received 0
WARNING: Error contacting Hash Equivalence Server unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 115 messages but only received 0
WARNING: Error contacting Hash Equivalence Server unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 165 messages but only received 0
WARNING: Error contacting Hash Equivalence Server unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 9 messages but only received 4
WARNING: Error contacting Hash Equivalence Server unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 99 messages but only received 0
WARNING: Error contacting Hash Equivalence Server unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 15 messages but only received 0
WARNING: Error contacting Hash Equivalence Server unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 9 messages but only received 0
WARNING: Error contacting Hash Equivalence Server unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 1 messages but only received 0
WARNING: Error contacting Hash Equivalence Server unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 4 messages but only received 0
WARNING: Error contacting Hash Equivalence Server unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 47 messages but only received 0
WARNING: Error contacting Hash Equivalence Server unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 1 messages but only received 0
WARNING: Error contacting Hash Equivalence Server unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 116 messages but only received 0
WARNING: Error contacting Hash Equivalence Server unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 112 messages but only received 0
WARNING: Error contacting Hash Equivalence Server unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 117 messages but only received 0
WARNING: Error contacting Hash Equivalence Server unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 277 messages but only received 0
WARNING: Error contacting Hash Equivalence Server unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 66 messages but only received 0
WARNING: Error contacting Hash Equivalence Server unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 72 messages but only received 0
WARNING: Error contacting Hash Equivalence Server unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 157 messages but only received 0
WARNING: Error contacting Hash Equivalence Server unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 45 messages but only received 0
WARNING: Error contacting Hash Equivalence Server unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 52 messages but only received 0
WARNING: Error contacting Hash Equivalence Server unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 75 messages but only received 0
WARNING: Error contacting Hash Equivalence Server unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 18 messages but only received 0
WARNING: Error contacting Hash Equivalence Server unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 10 messages but only received 0
WARNING: Error contacting Hash Equivalence Server unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 98 messages but only received 0
Initialising tasks:  44% |##########################################################                                                                           | ETA:  1:03:30

Then in another run, after reporting that 8 messages were sent, but 0 received, hashserve.sock disappeared!
WARNING: Error contacting Hash Equivalence Server unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 8 messages but only received 0
WARNING: Error contacting Hash Equivalence Server unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: [Errno 2] No such file or directory
WARNING: Error contacting Hash Equivalence Server unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: [Errno 2] No such file or directory
WARNING: Error contacting Hash Equivalence Server unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: [Errno 2] No such file or directory
Although that might be a different issue after killing previous run and not making sure all Cooker processes are actually dead?

Anyway, after properly making sure there are no lingering processes, I am still getting stuck at:
WARNING: [...] Sent 192 messages but only received 26
WARNING: [...] Sent 115 messages but only received 0
WARNING: [...] Sent 115 messages but only received 0
WARNING: [...] Sent 165 messages but only received 0
WARNING: [...] Sent 9 messages but only received 1

I will be going on vacation now, so unfortunately, I won't be able to test more if you come up with anything new.

Best regards,
Michal
Joshua Watt Aug. 26, 2026, 8:05 p.m. UTC | #2
Michal,

Any chance you've had time to look at this more? I've been unable to
reproduce this particular issue. It looks like the server is just crashing
or stuck somewhere where it's no longer responding, but I can't quite
figure out where that might be occurring.

Thanks,
Joshua Watt

On Fri, Jul 31, 2026 at 7:05 AM Michal Sieron via lists.openembedded.org
<michalwsieron=gmail.com@lists.openembedded.org> wrote:

> Hi,
>
> something is not working for me...
>
> In the first run I got it stuck for an hour at:
> WARNING: Error contacting Hash Equivalence Server
> unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 192
> messages but only received 49
> WARNING: Error contacting Hash Equivalence Server
> unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 115
> messages but only received 0
> WARNING: Error contacting Hash Equivalence Server
> unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 115
> messages but only received 0
> WARNING: Error contacting Hash Equivalence Server
> unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 165
> messages but only received 0
> WARNING: Error contacting Hash Equivalence Server
> unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 9
> messages but only received 4
> WARNING: Error contacting Hash Equivalence Server
> unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 99
> messages but only received 0
> WARNING: Error contacting Hash Equivalence Server
> unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 15
> messages but only received 0
> WARNING: Error contacting Hash Equivalence Server
> unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 9
> messages but only received 0
> WARNING: Error contacting Hash Equivalence Server
> unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 1
> messages but only received 0
> WARNING: Error contacting Hash Equivalence Server
> unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 4
> messages but only received 0
> WARNING: Error contacting Hash Equivalence Server
> unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 47
> messages but only received 0
> WARNING: Error contacting Hash Equivalence Server
> unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 1
> messages but only received 0
> WARNING: Error contacting Hash Equivalence Server
> unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 116
> messages but only received 0
> WARNING: Error contacting Hash Equivalence Server
> unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 112
> messages but only received 0
> WARNING: Error contacting Hash Equivalence Server
> unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 117
> messages but only received 0
> WARNING: Error contacting Hash Equivalence Server
> unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 277
> messages but only received 0
> WARNING: Error contacting Hash Equivalence Server
> unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 66
> messages but only received 0
> WARNING: Error contacting Hash Equivalence Server
> unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 72
> messages but only received 0
> WARNING: Error contacting Hash Equivalence Server
> unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 157
> messages but only received 0
> WARNING: Error contacting Hash Equivalence Server
> unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 45
> messages but only received 0
> WARNING: Error contacting Hash Equivalence Server
> unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 52
> messages but only received 0
> WARNING: Error contacting Hash Equivalence Server
> unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 75
> messages but only received 0
> WARNING: Error contacting Hash Equivalence Server
> unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 18
> messages but only received 0
> WARNING: Error contacting Hash Equivalence Server
> unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 10
> messages but only received 0
> WARNING: Error contacting Hash Equivalence Server
> unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 98
> messages but only received 0
> Initialising tasks:  44%
> |##########################################################
>                                                           | ETA:  1:03:30
>
> Then in another run, after reporting that 8 messages were sent, but 0
> received, hashserve.sock disappeared!
> WARNING: Error contacting Hash Equivalence Server
> unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: Sent 8
> messages but only received 0
> WARNING: Error contacting Hash Equivalence Server
> unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: [Errno 2] No
> such file or directory
> WARNING: Error contacting Hash Equivalence Server
> unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: [Errno 2] No
> such file or directory
> WARNING: Error contacting Hash Equivalence Server
> unix:///path/to/my/workdir/builds/yoctobuild/hashserve.sock: [Errno 2] No
> such file or directory
> Although that might be a different issue after killing previous run and
> not making sure all Cooker processes are actually dead?
>
> Anyway, after properly making sure there are no lingering processes, I am
> still getting stuck at:
> WARNING: [...] Sent 192 messages but only received 26
> WARNING: [...] Sent 115 messages but only received 0
> WARNING: [...] Sent 115 messages but only received 0
> WARNING: [...] Sent 165 messages but only received 0
> WARNING: [...] Sent 9 messages but only received 1
>
> I will be going on vacation now, so unfortunately, I won't be able to test
> more if you come up with anything new.
>
> Best regards,
> Michal
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#19895):
> https://lists.openembedded.org/g/bitbake-devel/message/19895
> Mute This Topic: https://lists.openembedded.org/mt/120523853/3616693
> Group Owner: bitbake-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [
> JPEWhacker@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
Michal Sieron Aug. 26, 2026, 10:48 p.m. UTC | #3
Hi Joshua,

> Any chance you've had time to look at this more? I've been unable to reproduce this particular issue. It looks like the server is just crashing or stuck somewhere where it's no longer responding, but I can't quite figure out where that might be occurring.

Unfortunately, I did not. But I just tried it again on my setup (new changes pulled since last time), and it reproduced immediately.
As I still don't have *that much* time to debug this I went and threw this at Cursor, which did find the issue and generated a fix and a minimal repro test.
I attached the patch.

Br,
Michał
Joshua Watt Aug. 27, 2026, 6:57 p.m. UTC | #4
Ah, the upstream server is the part I was missing. Ya, that fix is probably
correct. I'll run it through more testing and post it to the ML.

Thanks.

On Wed, Aug 26, 2026 at 4:48 PM Michal Sieron via lists.openembedded.org
<michalwsieron=gmail.com@lists.openembedded.org> wrote:

> Hi Joshua,
>
> > Any chance you've had time to look at this more? I've been unable to
> reproduce this particular issue. It looks like the server is just crashing
> or stuck somewhere where it's no longer responding, but I can't quite
> figure out where that might be occurring.
>
> Unfortunately, I did not. But I just tried it again on my setup (new
> changes pulled since last time), and it reproduced immediately.
> As I still don't have *that much* time to debug this I went and threw this
> at Cursor, which did find the issue and generated a fix and a minimal repro
> test.
> I attached the patch.
>
> Br,
> Michał
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#20062):
> https://lists.openembedded.org/g/bitbake-devel/message/20062
> Mute This Topic: https://lists.openembedded.org/mt/120523853/3616693
> Group Owner: bitbake-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [
> JPEWhacker@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>