diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-03-29 15:17:10 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-03-30 13:05:03 +0100 |
commit | 928bcb10a46939eaf801bea0b633e4624b5b5dfa (patch) | |
tree | 42f3bc730e5fd7f4306d7b090574e30343c85cee /bitbake/lib/bb/msg.py | |
parent | c0ff6c75eedea6e0f472b45456aed238073ac157 (diff) | |
download | poky-928bcb10a46939eaf801bea0b633e4624b5b5dfa.tar.gz |
bitbake: cooker/process: Fix signal handling lockups
If a parser process is terminated while holding a write lock, then it
will lead to a deadlock (see
https://docs.python.org/3/library/multiprocessing.html#multiprocessing.Process.terminate).
With SIGTERM, we don't want to terminate holding the lock. We also don't
want a SIGINT to cause a partial write to the event stream.
I tried using signal masks to avoid this but it doesn't work, see
https://bugs.python.org/issue47139
Instead, add a signal handler and catch the calls around the critical section.
We also need a thread lock to ensure other threads in the same process don't
handle the signal until all the threads are not in the lock.
(Bitbake rev: a40efaa5556a188dfe46c8d060adde37dc400dcd)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/msg.py')
0 files changed, 0 insertions, 0 deletions