summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/utils.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2025-03-03 11:56:15 +0000
committerSteve Sakoman <steve@sakoman.com>2025-03-15 06:40:07 -0700
commit798513440976cc9729b52a4f5ac00238dd642ef8 (patch)
tree57dfea1e8e2ecb06404c20729525c50232889037 /bitbake/lib/bb/utils.py
parente9aa48f80719bb847ec1a6fb01895223ab47489e (diff)
downloadpoky-798513440976cc9729b52a4f5ac00238dd642ef8.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: 5dbbca616a71047fc3573a2be49846d5c9cdd15a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit a9eb8bf7174b6962b5ba07192fe95b8c7112d9d2) Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'bitbake/lib/bb/utils.py')
-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 0dfe47dc5a..83e832c336 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -1859,8 +1859,8 @@ def path_is_descendant(descendant, ancestor):
1859# we exit at some point than hang. 5 minutes with no progress means we're probably deadlocked. 1859# we exit at some point than hang. 5 minutes with no progress means we're probably deadlocked.
1860@contextmanager 1860@contextmanager
1861def lock_timeout(lock): 1861def lock_timeout(lock):
1862 held = lock.acquire(timeout=5*60)
1863 try: 1862 try:
1863 held = lock.acquire(timeout=5*60)
1864 if not held: 1864 if not held:
1865 bb.server.process.serverlog("Couldn't get the lock for 5 mins, timed out, exiting.\n%s" % traceback.format_stack()) 1865 bb.server.process.serverlog("Couldn't get the lock for 5 mins, timed out, exiting.\n%s" % traceback.format_stack())
1866 os._exit(1) 1866 os._exit(1)