Skip to content

prserv: add --status, and make --start notice a dead server

Babanpreet Singh bitbake-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest3 patches 0 repliesNew

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3prserv/tests: run ScriptTests on a free port with one databaselib/prserv/tests.py+15 -70 replies
2/3prserv: make --start fail when the server does not come uplib/prserv/serv.py lib/prserv/tests.py+60 -70 replies
3/3prserv: add --status to list running serversbin/bitbake-prserv lib/prserv/serv.py lib/prserv/tests.py+47 -10 replies

Reviews trailers per patch

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

Read the v2 thread

Cover letter [PATCH v2 0/3] prserv: add --status, and make --start notice a dead server

v1 of --status failed bitbake-selftest on the autobuilder: test_2 found a stale pidfile for the server test_1 had just started. The daemon dies somewhere between writing its pidfile and serving, and --start cannot tell, because it returns once the intermediate fork exits. The old start/stop pair never noticed a dead server since --stop treats a stale pidfile as success. Every autobuilder run that carried v1 failed the same way (26 runs on 20 workers, on Richard's and Mathieu's master-next) while it passes here. Binding 8585 before --start gives the identical symptom, but the workers' prserv.log is not published so I do not know what kills it there.

1/3 ScriptTests picks a free port and keeps one database directory
for the class instead of 8585 and a directory per test.
2/3 --start waits until the daemon has bound and opened its database,
and exits 1 with the daemon's error and the logfile path if it fails first. The daemon removes its pidfile on failure. New test:
--start on a busy port fails and leaves no pidfile.
3/3 --status, as in v1, with the tests on the class port.

If the daemon still dies on the autobuilder, test_1 fails with the reason in the log rather than test_2 with a stale pidfile.

Tested on top of 046a90b0e: prserv.tests 10/10 at the tip and at each intermediate commit, ScriptTests 20 runs in a row clean, and the rest of bitbake-selftest module by module with BB_SKIP_NETTESTS=yes, all OK except hashserv.tests, which hangs on this host with or without these patches.

Babanpreet Singh (3):
prserv/tests: run ScriptTests on a free port with one database
prserv: make --start fail when the server does not come up
prserv: add --status to list running servers

 bin/bitbake-prserv  |  7 +++++
 lib/prserv/serv.py  | 76 ++++++++++++++++++++++++++++++++++++++++-----
 lib/prserv/tests.py | 54 +++++++++++++++++++++++++++-----
 3 files changed, 122 insertions(+), 15 deletions(-)
Signature · 1 line
2.43.0