diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-03-03 11:58:57 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-03-03 21:38:57 +0000 |
commit | cffc7a1d056c462ffd25ea4de1534111eccb5f71 (patch) | |
tree | 521217ce31cfe9e14ad01ce75f3265b473c1af8b /bitbake/lib/bb/utils.py | |
parent | 14bf122313f901cd3b3b46c272bc07474769ebc9 (diff) | |
download | poky-cffc7a1d056c462ffd25ea4de1534111eccb5f71.tar.gz |
bitbake: utils: Add signal blocking for lock_timeout
We never want to exit whilst holding these locks as it deadlocks all python
threads. Add signal blocking around the lock critical part so a signal
shouldn't cause such an exit.
(Bitbake rev: a097755c671e2b530dea6200a94b39fa9dca246c)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/utils.py')
-rw-r--r-- | bitbake/lib/bb/utils.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 992e200641..3a4b29181e 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py | |||
@@ -1882,6 +1882,7 @@ def path_is_descendant(descendant, ancestor): | |||
1882 | @contextmanager | 1882 | @contextmanager |
1883 | def lock_timeout(lock): | 1883 | def lock_timeout(lock): |
1884 | try: | 1884 | try: |
1885 | s = signal.pthread_sigmask(signal.SIG_BLOCK, signal.valid_signals()) | ||
1885 | held = lock.acquire(timeout=5*60) | 1886 | held = lock.acquire(timeout=5*60) |
1886 | if not held: | 1887 | if not held: |
1887 | bb.server.process.serverlog("Couldn't get the lock for 5 mins, timed out, exiting.\n%s" % traceback.format_stack()) | 1888 | bb.server.process.serverlog("Couldn't get the lock for 5 mins, timed out, exiting.\n%s" % traceback.format_stack()) |
@@ -1889,3 +1890,4 @@ def lock_timeout(lock): | |||
1889 | yield held | 1890 | yield held |
1890 | finally: | 1891 | finally: |
1891 | lock.release() | 1892 | lock.release() |
1893 | signal.pthread_sigmask(signal.SIG_SETMASK, s) | ||