]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
server/process: Try connecting 4 times before giving up
authorLucas Dutra Nunes <ldnunes@ossystems.com.br>
Tue, 1 Mar 2016 13:13:34 +0000 (10:13 -0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 9 Mar 2016 22:47:06 +0000 (22:47 +0000)
Instead of trying one time with a timeout of 20 seconds try 4 times with
a timeout of 5 seconds, to account for a slow server start.

Signed-off-by: Lucas Dutra Nunes <ldnunes@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/server/process.py

index 1e2b8249a9701ca845964d0875a90653b31164ac..e387b30ee354c7de3ae5e668baa9ea5015d0f54b 100644 (file)
@@ -53,10 +53,12 @@ class ServerCommunicator():
         while True:
             # don't let the user ctrl-c while we're waiting for a response
             try:
-                if self.connection.poll(20):
-                    return self.connection.recv()
-                else:
-                    bb.fatal("Timeout while attempting to communicate with bitbake server")
+                for idx in range(0,4): # 0, 1, 2, 3
+                    if self.connection.poll(5):
+                        return self.connection.recv()
+                    else:
+                        bb.warn("Timeout while attempting to communicate with bitbake server")
+                bb.fatal("Gave up; Too many tries: timeout while attempting to communicate with bitbake server")
             except KeyboardInterrupt:
                 pass