Skip to content

RFC Modernise prserv

Paul Barker bitbake-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest11 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11hashserv: Use generic ConnectionErrorlib/bb/siggen.py lib/hashserv/client.py lib/hashserv/tests.py+12 -170 replies
2/11asyncrpc: Common implementation of RPC using json & asynciolib/bb/asyncrpc/__init__.py lib/bb/asyncrpc/client.py lib/bb/asyncrpc/serv.py+394 -00 replies
3/11hashserv: Refactor to use asyncrpclib/hashserv/client.py lib/hashserv/server.py+41 -3060 replies
4/11prserv: Drop obsolete python version checklib/prserv/serv.py+0 -40 replies
5/11asyncrpc: Add ping methodlib/bb/asyncrpc/client.py lib/bb/asyncrpc/serv.py+11 -10 replies
6/11prserv: Use multiprocessing to auto start prserverlib/prserv/serv.py+8 -40 replies
7/11prserv: Extract daemonization from PRServer classlib/prserv/serv.py+72 -1030 replies
8/11prserv: Handle requests in main threadlib/prserv/serv.py+36 -1230 replies
9/11prserv: Drop unused methodslib/prserv/serv.py+0 -270 replies
10/11prserv: Replace XML RPC with modern asyncrpc implementationlib/prserv/serv.py+129 -1230 replies
11/11prserv: Add connect functionlib/prserv/serv.py+11 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 00/11] Modernise prserv

The prserv module is converted from the old XML RPC mechinism to the more modern json + asyncio RPC system used by hashserv. The common code now shared between hashserv and prserv is moved to a new asyncrpc module. The startup and shutdown code within prserv is also refactored and modernised, using the Python multiprocessing module where possible.

These changes are not expected to land in the upcoming 3.3 release, they're currently submitted as an RFC to get some early review.

The following change is needed in oe-core when testing these patches, this can be submitted separately once these changes are past the RFC stage:

    diff --git a/meta/lib/oe/prservice.py b/meta/lib/oe/prservice.py
    index fcdbe66c19..15ce060ff6 100644
    --- a/meta/lib/oe/prservice.py
    +++ b/meta/lib/oe/prservice.py
    @@ -7,7 +7,7 @@ def prserv_make_conn(d, check = False):
        host_params = list([_f for _f in (d.getVar("PRSERV_HOST") or '').split(':') if _f])
        try:
            conn = None
    -        conn = prserv.serv.PRServerConnection(host_params[0], int(host_params[1]))
    +        conn = prserv.serv.connect(host_params[0], int(host_params[1]))
            if check:
                if not conn.ping():
                    raise Exception('service not available')

I'm also currently working on a follow-up patch which will add a read-only mode to prserv.

Let me know if there are any other questions :)

Paul Barker (11):
hashserv: Use generic ConnectionError
asyncrpc: Common implementation of RPC using json & asyncio
hashserv: Refactor to use asyncrpc
prserv: Drop obsolete python version check
asyncrpc: Add ping method
prserv: Use multiprocessing to auto start prserver
prserv: Extract daemonization from PRServer class
prserv: Handle requests in main thread
prserv: Drop unused methods
prserv: Replace XML RPC with modern asyncrpc implementation
prserv: Add connect function

 lib/bb/asyncrpc/__init__.py |  31 ++
 lib/bb/asyncrpc/client.py   | 150 ++++++++++
 lib/bb/asyncrpc/serv.py     | 223 +++++++++++++++
 lib/bb/siggen.py            |   6 +-
 lib/hashserv/client.py      | 147 ++--------
 lib/hashserv/server.py      | 210 ++------------
 lib/hashserv/tests.py       |   3 +-
 lib/prserv/serv.py          | 550 ++++++++++++++----------------------
 8 files changed, 663 insertions(+), 657 deletions(-)
 create mode 100644 lib/bb/asyncrpc/__init__.py
 create mode 100644 lib/bb/asyncrpc/client.py
 create mode 100644 lib/bb/asyncrpc/serv.py
Signature · 1 line
2.26.2