From 14bf122313f901cd3b3b46c272bc07474769ebc9 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Mon, 3 Mar 2025 11:56:15 +0000 Subject: bitbake: utils: Tweak lock_timeout logic We should really try and take the lock in the try/finally block so that in some rare cases such as badly timed interrupt/signal, we always release the lock. (Bitbake rev: a9eb8bf7174b6962b5ba07192fe95b8c7112d9d2) Signed-off-by: Richard Purdie --- bitbake/lib/bb/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bitbake') diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index da8c20fe95..992e200641 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py @@ -1881,8 +1881,8 @@ def path_is_descendant(descendant, ancestor): # we exit at some point than hang. 5 minutes with no progress means we're probably deadlocked. @contextmanager def lock_timeout(lock): - held = lock.acquire(timeout=5*60) try: + 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()) os._exit(1) -- cgit v1.2.3-54-g00ecf