1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-09 05:29:32 +00:00

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>
This commit is contained in:
Richard Purdie
2025-03-03 11:58:57 +00:00
parent 14bf122313
commit cffc7a1d05
+2
View File
@@ -1882,6 +1882,7 @@ def path_is_descendant(descendant, ancestor):
@contextmanager
def lock_timeout(lock):
try:
s = signal.pthread_sigmask(signal.SIG_BLOCK, signal.valid_signals())
held = lock.acquire(timeout=5*60)
if not held:
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):
yield held
finally:
lock.release()
signal.pthread_sigmask(signal.SIG_SETMASK, s)