[oe-commits] [bitbake] 03/04: process: Clean up server communication timeout errors
git at git.openembedded.org
git at git.openembedded.org
Fri Jul 28 22:04:05 UTC 2017
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master-next
in repository bitbake.
commit 8633b7cd03cfaba3e0359aa5da22fc76b66768c7
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Fri Jul 28 15:46:20 2017 +0100
process: Clean up server communication timeout errors
This timeout path was commonly hit due to errors starting the server. Now we
have a better way to handle that, the retry logic can be improved and cleaned
up. This patch:
* Makes the timeout 5s rather than intervals of 1s with a message. Paul
noted some commands can take around 1s to run on a server which has just
been started on a loaded system.
* Allows a broke connection to exit immediately rather than retrying something
which will never work.
* Drops the Ctrl+C masking, we shouldn't need that anymore and any issues
would be better handled in other ways.
This should make things clearer and less confusing for users and is much cleaner
code too.
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
lib/bb/server/process.py | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py
index 3530bdc..e4b9d96 100644
--- a/lib/bb/server/process.py
+++ b/lib/bb/server/process.py
@@ -303,19 +303,10 @@ class ServerCommunicator():
self.recv = recv
def runCommand(self, command):
-
self.connection.send(command)
- while True:
- # don't let the user ctrl-c while we're waiting for a response
- try:
- for idx in range(0,4): # 0, 1, 2, 3
- if self.recv.poll(1):
- return self.recv.get()
- else:
- bb.note("Timeout while attempting to communicate with bitbake server, retrying...")
- raise ProcessTimeout("Gave up; Too many tries: timeout while attempting to communicate with bitbake server")
- except KeyboardInterrupt:
- pass
+ if not self.recv.poll(5):
+ raise ProcessTimeout("Timeout while waiting for a reply from the bitbake server")
+ return self.recv.get()
def updateFeatureSet(self, featureset):
_, error = self.runCommand(["setFeatures", featureset])
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list