mirror of
https://git.yoctoproject.org/git/poky
synced 2026-01-01 13:58:04 +00:00
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>
This commit is contained in:
parent
c0432f8eda
commit
a5d5ce74e8
|
|
@ -1859,8 +1859,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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user