summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2025-03-03 11:58:57 +0000
committerSteve Sakoman <steve@sakoman.com>2025-03-15 06:40:07 -0700
commit7eea22a7cdb28792f6e76823558dff8de9f2f039 (patch)
tree13404cb9fefe0a062eb365c2119e5cca9e7a9313 /bitbake
parent798513440976cc9729b52a4f5ac00238dd642ef8 (diff)
downloadpoky-7eea22a7cdb28792f6e76823558dff8de9f2f039.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: 5cc1dde1ffd9382b3a9e4cc182be067defba16a7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit a097755c671e2b530dea6200a94b39fa9dca246c) Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/utils.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index 83e832c336..da026fe5bf 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -1860,6 +1860,7 @@ def path_is_descendant(descendant, ancestor):
1860@contextmanager 1860@contextmanager
1861def lock_timeout(lock): 1861def lock_timeout(lock):
1862 try: 1862 try:
1863 s = signal.pthread_sigmask(signal.SIG_BLOCK, signal.valid_signals())
1863 held = lock.acquire(timeout=5*60) 1864 held = lock.acquire(timeout=5*60)
1864 if not held: 1865 if not held:
1865 bb.server.process.serverlog("Couldn't get the lock for 5 mins, timed out, exiting.\n%s" % traceback.format_stack()) 1866 bb.server.process.serverlog("Couldn't get the lock for 5 mins, timed out, exiting.\n%s" % traceback.format_stack())
@@ -1867,3 +1868,4 @@ def lock_timeout(lock):
1867 yield held 1868 yield held
1868 finally: 1869 finally:
1869 lock.release() 1870 lock.release()
1871 signal.pthread_sigmask(signal.SIG_SETMASK, s)