[oe-commits] [bitbake] 02/02: main: Attempt to gain bitbake.lock rather than just waiting

git at git.openembedded.org git at git.openembedded.org
Thu Aug 24 12:49:47 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository bitbake.

commit 8a60106c6f7d586c793b965c5e9460b6016fab15
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Thu Aug 24 00:21:53 2017 +0100

    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.
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/main.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/lib/bb/main.py b/lib/bb/main.py
index 07972f6..6e6a346 100755
--- a/lib/bb/main.py
+++ b/lib/bb/main.py
@@ -446,7 +446,15 @@ def setup_bitbake(configParams, configuration, extrafeatures=None):
                     logger.info("Reconnecting to bitbake server...")
                     if not os.path.exists(sockname):
                         print("Previous bitbake instance shutting down?, waiting to retry...")
-                        time.sleep(5)
+                        i = 0
+                        lock = None
+                        # Wait for 5s or until we can get the lock
+                        while not lock and i < 50:
+                            time.sleep(0.1)
+                            _, lock = lockBitbake()
+                            i += 1
+                        if lock:
+                            bb.utils.unlockfile(lock)
                         raise bb.server.process.ProcessTimeout("Bitbake still shutting down as socket exists but no lock?")
                 if not configParams.server_only:
                     try:

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list