diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-03-03 11:56:15 +0000 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2025-03-13 07:21:43 -0700 |
| commit | a5d5ce74e8bd75a7d3abefed52d5e8c9cabc1330 (patch) | |
| tree | 34bd1e44b724d7a6d3b6203287c96dc137fa6425 | |
| parent | c0432f8eda225aef979a27ac5977e5dd8847f086 (diff) | |
| download | poky-a5d5ce74e8bd75a7d3abefed52d5e8c9cabc1330.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: f0f7bed1291afd63a27f1863901445e6d40c4a09)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit a9eb8bf7174b6962b5ba07192fe95b8c7112d9d2)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
| -rw-r--r-- | bitbake/lib/bb/utils.py | 2 |
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 |
| 1861 | def lock_timeout(lock): | 1861 | def 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) |
