diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-08-24 00:21:53 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-08-24 13:48:40 +0100 |
commit | 4152c472430db1b32c943026f8c976bb99b9717b (patch) | |
tree | e8e74f0ea43cf6f3d5c210ba7cbf769d39e41392 /bitbake/lib/bb/main.py | |
parent | 2b453483d4610945c6156cc7f472ffae803cb28a (diff) | |
download | poky-4152c472430db1b32c943026f8c976bb99b9717b.tar.gz |
bitbake: main: Attempt to gain bitbake.lock rather than just waiting
Rather than just waiting for 5s, try and get the lockfile. If we gain
the lock, we know we're ready to retry and can skip any remaining timeout.
(Bitbake rev: 8a60106c6f7d586c793b965c5e9460b6016fab15)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/main.py')
-rwxr-xr-x | bitbake/lib/bb/main.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/bitbake/lib/bb/main.py b/bitbake/lib/bb/main.py index 07972f69e5..6e6a346a06 100755 --- a/bitbake/lib/bb/main.py +++ b/bitbake/lib/bb/main.py | |||
@@ -446,7 +446,15 @@ def setup_bitbake(configParams, configuration, extrafeatures=None): | |||
446 | logger.info("Reconnecting to bitbake server...") | 446 | logger.info("Reconnecting to bitbake server...") |
447 | if not os.path.exists(sockname): | 447 | if not os.path.exists(sockname): |
448 | print("Previous bitbake instance shutting down?, waiting to retry...") | 448 | print("Previous bitbake instance shutting down?, waiting to retry...") |
449 | time.sleep(5) | 449 | i = 0 |
450 | lock = None | ||
451 | # Wait for 5s or until we can get the lock | ||
452 | while not lock and i < 50: | ||
453 | time.sleep(0.1) | ||
454 | _, lock = lockBitbake() | ||
455 | i += 1 | ||
456 | if lock: | ||
457 | bb.utils.unlockfile(lock) | ||
450 | raise bb.server.process.ProcessTimeout("Bitbake still shutting down as socket exists but no lock?") | 458 | raise bb.server.process.ProcessTimeout("Bitbake still shutting down as socket exists but no lock?") |
451 | if not configParams.server_only: | 459 | if not configParams.server_only: |
452 | try: | 460 | try: |