summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2025-03-03 11:56:15 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-03-03 21:38:57 +0000
commit14bf122313f901cd3b3b46c272bc07474769ebc9 (patch)
tree1d9f950cbb76b8899d0f1a1fab4791c637bc26a1 /bitbake
parent6b01f33b33d07df805d9da50d2d16183dcfaf81f (diff)
downloadpoky-14bf122313f901cd3b3b46c272bc07474769ebc9.tar.gz
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 <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/utils.py2
1 files changed, 1 insertions, 1 deletions
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):
1881# we exit at some point than hang. 5 minutes with no progress means we're probably deadlocked. 1881# we exit at some point than hang. 5 minutes with no progress means we're probably deadlocked.
1882@contextmanager 1882@contextmanager
1883def lock_timeout(lock): 1883def lock_timeout(lock):
1884 held = lock.acquire(timeout=5*60)
1885 try: 1884 try:
1885 held = lock.acquire(timeout=5*60)
1886 if not held: 1886 if not held:
1887 bb.server.process.serverlog("Couldn't get the lock for 5 mins, timed out, exiting.\n%s" % traceback.format_stack()) 1887 bb.server.process.serverlog("Couldn't get the lock for 5 mins, timed out, exiting.\n%s" % traceback.format_stack())
1888 os._exit(1) 1888 os._exit(1)