Bug 14341 - BitbakePrTests.test_stopping_prservice_message fails
Summary: BitbakePrTests.test_stopping_prservice_message fails
Status: RESOLVED FIXED
Alias: None
Product: Functional (self) Testing
Classification: QA/Testing
Component: oe-selftest (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium normal
Target Milestone: 5.0
Assignee: Yoann Congal
QA Contact:
URL:
Whiteboard: AB-INT AB-HAVE-PLAN
Depends on:
Blocks:
 
Reported: 2021-04-07 18:23 UTC by Alejandro
Modified: 2024-03-05 16:01 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alejandro 2021-04-07 18:23:21 UTC
The PR server stop command was unsuccessful since the pid tmp file doesnt exist:

AssertionError: Command 'bitbake-prserv --host localhost --port 34207 --loglevel=DEBUG --stop' returned non-zero exit status 1:
Traceback (most recent call last):
  File "/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/bitbake/bin/bitbake-prserv", line 53, in <module>
    ret = main()
  File "/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/bitbake/bin/bitbake-prserv", line 46, in main
    ret=prserv.serv.stop_daemon(options.host, options.port)
  File "/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/bitbake/lib/prserv/serv.py", line 426, in stop_daemon
    raise e
  File "/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/bitbake/lib/prserv/serv.py", line 421, in stop_daemon
    os.remove(pidfile)
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/PRServer_127.0.0.1_34207.pid'
Waiting for pr-server to exit.
Sending SIGTERM to pr-server.

More details at:
https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/2002/steps/14/logs/stdio
Comment 1 Randy MacLeod 2021-04-08 14:55:21 UTC
Looks like a shutdown race condition.
Comment 2 Randy MacLeod 2021-10-21 14:58:20 UTC
We think this is a race that we should keep looking for an fix.
Comment 3 Randy MacLeod 2023-10-30 15:37:32 UTC
Build move to 5.0 -- ../Randy
Comment 4 Yoann Congal 2024-02-22 16:19:43 UTC
Transcribing Richard's comment during the triage meeting:
https://git.yoctoproject.org/poky/tree/bitbake/lib/prserv/serv.py#n265:
        if os.path.exists(pidfile):
            os.remove(pidfile)
=> pidfile might be removed by the exiting process between those 2 lines and trigger the FileNotFoundError exception

A fix might be to encase the os.remove in a try/except to ignore silently this case.
Comment 5 Yoann Congal 2024-02-29 21:58:10 UTC
Patch sent : https://lists.openembedded.org/g/bitbake-devel/message/15981