[bitbake-devel] bitbake-prserv not exiting on SIGTERM when run in daemon mode

Diego Santa Cruz Diego.SantaCruz at spinetix.com
Tue Feb 2 14:33:13 UTC 2016


Hi there,

As reported in bug #9035 [1] there is an issue in the daemon mode of the PR Service where it hangs when sent a SIGTERM.

The description I entered in the bug report is the following. The attached patch solves this problem for me.

I am running bitbake-prserv in daemon mode and noticed that it does not exit when a SIGTERM is sent to it.

Using "bitbake-prserv --stop" works fine, but sending a SIGTERM to the pid of the daemonized bitbake-prserv hungs it and then even a "bitbake-prserv --stop" is not able to stop it.

The problem seems to be that the handler thread is not signaled to quit, so it stays there doing its work, as it is not a daemon thread (i.e. the python thread is created in non-daemon mode).

The attached patch fixes this by setting the quit variable instead. The patch also does not raise the SystemExit exception any longer but instead leaves the quit flag to do its job and do a clean exit. This way the PID file is properly removed.

Best regards,

Diego

[1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=9035
--
Diego Santa Cruz, PhD
Technology Architect
T +41 21 341 15 50
diego.santacruz at spinetix.com
spinetix.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/bitbake-devel/attachments/20160202/9605843d/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-bitbake-prserv-SIGTERM-handling-hung-process.patch
Type: application/octet-stream
Size: 1289 bytes
Desc: 0001-bitbake-prserv-SIGTERM-handling-hung-process.patch
URL: <http://lists.openembedded.org/pipermail/bitbake-devel/attachments/20160202/9605843d/attachment-0002.obj>


More information about the bitbake-devel mailing list