Skip to content

Modernise prserv startup & request handling

Paul Barker bitbake-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4prserv: Use multiprocessing to auto start prserverlib/prserv/serv.py+8 -40 replies
2/4prserv: Extract daemonization from PRServer classlib/prserv/serv.py+72 -1030 replies
3/4prserv: Handle requests in main threadlib/prserv/serv.py+36 -1230 replies
4/4prserv: Add 15s timeout to auto shutdownlib/prserv/serv.py+3 -10 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/4] Modernise prserv startup & request handling

These patches continue the preparation of the prserv code for the update to a json-based asyncrpc system.

When the prservice process is auto-started by bitbake we can make use of the Python multiprocessing module to simplify startup and shutdown. When running as a daemon via bitbake-prserv we still need to do the double-fork dance but this is extracted from the PRServer class into a new run_as_daemon function to simplify further changes. Since prservice requests are already handled in a dedicated process we don't need to also have a separate handling thread.

These changes are basically equivalent to those submitted in the previous RFC series but with an additional patch to add a timeout when automatically shutting down the prservice process. Hopefully this will prevent bitbake from hanging during testing.

I've ran these changes through both bitbake-selftest and oe-selftest -a and all looks good on my end. A couple of failures were seen in oe-selftest but these are related to my host system configuration (socat not installed, firewall blocking ports, etc) so I'm fairly confident they aren't caused by this patch series.

Paul Barker (4):
prserv: Use multiprocessing to auto start prserver
prserv: Extract daemonization from PRServer class
prserv: Handle requests in main thread
prserv: Add 15s timeout to auto shutdown

 lib/prserv/serv.py | 338 +++++++++++++++------------------------------
 1 file changed, 113 insertions(+), 225 deletions(-)
Signature · 1 line
2.26.2