<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/poky.git/bitbake/lib/bb/asyncrpc, branch yocto-4.0.19</title>
<subtitle>Mirror of git.yoctoproject.org/poky</subtitle>
<id>https://git.enea.com/cgit/linux/poky.git/atom?h=yocto-4.0.19</id>
<link rel='self' href='https://git.enea.com/cgit/linux/poky.git/atom?h=yocto-4.0.19'/>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/'/>
<updated>2024-01-10T15:14:16+00:00</updated>
<entry>
<title>bitbake: asyncrpc: Add context manager API</title>
<updated>2024-01-10T15:14:16+00:00</updated>
<author>
<name>Joshua Watt</name>
<email>JPEWhacker@gmail.com</email>
</author>
<published>2023-11-03T14:26:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=6c7c9b11465a0f35cbae907b8b9d5374f8130587'/>
<id>urn:sha1:6c7c9b11465a0f35cbae907b8b9d5374f8130587</id>
<content type='text'>
Adds context manager API for the asyncrcp client class which allow
writing code that will automatically close the connection like so:

    with hashserv.create_client(address) as client:
       ...

Rework the bitbake-hashclient tool and PR server to use this new API to
fix warnings about unclosed event loops when exiting

(Bitbake rev: ee090484cc25d760b8c20f18add17b5eff485b40)

Signed-off-by: Joshua Watt &lt;JPEWhacker@gmail.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
(cherry picked from commit d01d684a0f6398270fe35ed59b7d28f3fd9b7e41)
Signed-off-by: Steve Sakoman &lt;steve@sakoman.com&gt;
</content>
</entry>
<entry>
<title>bitbake: asyncrpc/client: Fix unix domain socket chdir race issues</title>
<updated>2022-10-11T20:57:28+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2022-09-02T20:50:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=67e4012e6261b3e8c7e980dd546acc65c038341d'/>
<id>urn:sha1:67e4012e6261b3e8c7e980dd546acc65c038341d</id>
<content type='text'>
The connect_unix() call had a bug where if a relative path to a socket
was passed (which the non-async client always does), and the current
working directory was changed after the initial call, it would fail to
reconnect if it became disconnected, since the socket couldn't be found
relative to the new current working directory.

To work around this, change the socket connection for UNIX domain
sockets to be synchronous and change current working before connecting.
This isn't ideal since the connection could block the entire event loop,
but in practice this shouldn't happen since the socket are local files
anyway.

Help debugging and resolving from Joshua Watt.

(Bitbake rev: 6603c3e39f1cf746669ec6c9f0be8c6e6ece426e)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
(cherry picked from commit 5964bb67bb20df7f411ee0650cf189504a05cf25)
Signed-off-by: Steve Sakoman &lt;steve@sakoman.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: bitbake: Add copyright headers where missing</title>
<updated>2022-10-11T20:57:28+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2022-08-10T19:58:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=0ac71c5480e2226e3e6993ca2b30bbdf64813226'/>
<id>urn:sha1:0ac71c5480e2226e3e6993ca2b30bbdf64813226</id>
<content type='text'>
Where copyright headers were not present, add them to make things
clear.

(Bitbake rev: e591325b2bd901c381003deb96a7b32a7148e93e)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
(cherry picked from commit 1aa338a216350a2751fff52f866039343e9ac013)
Signed-off-by: Steve Sakoman &lt;steve@sakoman.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: asyncrpc: Fix attribute errors</title>
<updated>2022-02-17T17:51:03+00:00</updated>
<author>
<name>Daniel Gomez</name>
<email>daniel@qtec.com</email>
</author>
<published>2022-02-14T12:51:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=22027da10a85194c61f1e686d1a819cc3bcfcf33'/>
<id>urn:sha1:22027da10a85194c61f1e686d1a819cc3bcfcf33</id>
<content type='text'>
Export ClientError and ServerError classes from bb.asyncrpc.serv as
required by lib/hashserv/server.py module.

Error:
Client ('192.168.2.184', 51142) connected
Error from client: module 'bb.asyncrpc' has no attribute 'ClientError'
Traceback (most recent call last):
  File "/opt/bbhashserv/lib/bb/asyncrpc/serv.py", line 192, in handle_client
    await client.process_requests()
  File "/opt/bbhashserv/lib/hashserv/server.py", line 200, in process_requests
    await super().process_requests()
  File "/opt/bbhashserv/lib/bb/asyncrpc/serv.py", line 72, in process_requests
    await self.dispatch_message(d)
  File "/opt/bbhashserv/lib/hashserv/server.py", line 217, in dispatch_message
    raise bb.asyncrpc.ClientError("Unrecognized command %r" % msg)
AttributeError: module 'bb.asyncrpc' has no attribute 'ClientError'

(Bitbake rev: 8aca1d341500af8bbe788801c2df3da9bbfacaed)

Signed-off-by: Daniel Gomez &lt;daniel@qtec.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: async: Close sync client event loop</title>
<updated>2021-10-11T10:00:06+00:00</updated>
<author>
<name>Joshua Watt</name>
<email>JPEWhacker@gmail.com</email>
</author>
<published>2021-10-07T02:57:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=cac6facc9dd125ccf156406f7f3fac84e97f28dc'/>
<id>urn:sha1:cac6facc9dd125ccf156406f7f3fac84e97f28dc</id>
<content type='text'>
Prevents `ResourceWarning: unclosed event loop` warnings when using the
synchronous client and python exits

(Bitbake rev: 8b95972bc04ce52a98c7780184af15a5e95f987b)

Signed-off-by: Joshua Watt &lt;JPEWhacker@gmail.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: bitbake: asyncrpc: always create new asyncio loops</title>
<updated>2021-08-23T07:30:54+00:00</updated>
<author>
<name>Scott Murray</name>
<email>scott.murray@konsulko.com</email>
</author>
<published>2021-08-19T16:46:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=4df610473f21da79164ed01927103d13240d4c2a'/>
<id>urn:sha1:4df610473f21da79164ed01927103d13240d4c2a</id>
<content type='text'>
asyncio in older Python 3.x (seen with 3.7) can seemingly hang if
new_event_loop is called repeatedly in the same process.  The
reuse of processes in the Bitbake thread pool during parsing seems
to be able to trigger this with the PR server export selftest.
It appears that calling set_event_loop with the new loop avoids the
issue, so that is now done in the asyncrpc Client initializer (with
an explanatory comment).  This should be revisited when the day
arrives that Python 3.9 becomes the minimum required for BitBake.

Additionally, it was discovered that using get_event_loop in the
asyncrpc server initialization can trigger hangs in the hashserv
unittests when the second test is run.  To avoid this, switch to
calling new_event_loop + set_event_loop in the initialization code
there as well.

(Bitbake rev: bb9a36563505652294b20b4c88199b24fa208342)

Signed-off-by: Scott Murray &lt;scott.murray@konsulko.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: bitbake: asyncrpc: Defer all asyncio to child process</title>
<updated>2021-08-23T07:30:54+00:00</updated>
<author>
<name>Joshua Watt</name>
<email>JPEWhacker@gmail.com</email>
</author>
<published>2021-08-19T16:46:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=fdc908f321da852856a07c19e3d9a33ccb273dda'/>
<id>urn:sha1:fdc908f321da852856a07c19e3d9a33ccb273dda</id>
<content type='text'>
Reworks the async I/O API so that the async loop is only created in the
child process. This requires deferring the creation of the server until
the child process and a queue to transfer the bound address back to the
parent process

(Bitbake rev: 8555869cde39f9e9a9ced5a3e5788209640f6d50)

Signed-off-by: Joshua Watt &lt;JPEWhacker@gmail.com&gt;
[small loop -&gt; self.loop fix in serv.py]
Signed-off-by: Scott Murray &lt;scott.murray@konsulko.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: bitbake: asyncrpc: Catch early SIGTERM</title>
<updated>2021-07-29T22:21:24+00:00</updated>
<author>
<name>Joshua Watt</name>
<email>jpewhacker@gmail.com</email>
</author>
<published>2021-07-22T16:19:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=a83ea01b99d799025caede57512648d3258579d0'/>
<id>urn:sha1:a83ea01b99d799025caede57512648d3258579d0</id>
<content type='text'>
If the SIGTERM signal is sent to an asyncrpc server before it has
installed the SIGTERM handler in the main loop, it may miss the signal
which will can cause the calling process to wait forever on the join().
To resolve this, the calling process should mask of SIGTERM before
forking the server process and the server should unmask the signal only
after the handler is installed. To simplify the usage of the server, an
new helper function called serve_as_process() is added to do this
automatically and correctly.

Thanks: Scott Murray &lt;scott.murray@konsulko.com&gt; for helping debug
(Bitbake rev: ef2865efa98ad20823267364f2159d8d8c931400)

Signed-off-by: Joshua Watt &lt;JPEWhacker@gmail.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: asyncrpc: Set timeout when waiting for reply from server</title>
<updated>2021-07-29T22:21:24+00:00</updated>
<author>
<name>Paul Barker</name>
<email>pbarker@konsulko.com</email>
</author>
<published>2021-06-07T15:03:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=445c5b9324a6243a0a3941c5f00e369d7749efde'/>
<id>urn:sha1:445c5b9324a6243a0a3941c5f00e369d7749efde</id>
<content type='text'>
(Bitbake rev: b31f1853d7fcb8b8f8885ca513a0021a5d0301e6)

Signed-off-by: Paul Barker &lt;pbarker@konsulko.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: asyncrpc: Fix bad message error in client</title>
<updated>2021-07-29T22:21:24+00:00</updated>
<author>
<name>Paul Barker</name>
<email>pbarker@konsulko.com</email>
</author>
<published>2021-06-07T15:03:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=57ec655accca89f0e8d1756cf7b2e73741240e11'/>
<id>urn:sha1:57ec655accca89f0e8d1756cf7b2e73741240e11</id>
<content type='text'>
If there is an issue with the format of the reply given by the server then we
should print this reply line in the error message. Printing the message which
the client sent doesn't illuminate anything here.

(Bitbake rev: bd8f8d7b055da15cd7bdd0b383061852a0f54cb7)

Signed-off-by: Paul Barker &lt;pbarker@konsulko.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
</feed>
