summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/server/process.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-07-28 15:46:20 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-07-30 08:43:36 +0100
commit5f835043f24cef29d229918a9e9cdef62407e558 (patch)
tree89c591f805b8fdc0048c63b2c32290b666d65be7 /bitbake/lib/bb/server/process.py
parent07cee9dea1ad3408a49e4b9d9f5318474ddfa60b (diff)
downloadpoky-5f835043f24cef29d229918a9e9cdef62407e558.tar.gz
bitbake: 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. (Bitbake rev: 8633b7cd03cfaba3e0359aa5da22fc76b66768c7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/server/process.py')
-rw-r--r--bitbake/lib/bb/server/process.py15
1 files changed, 3 insertions, 12 deletions
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py
index 3530bdc07e..e4b9d96234 100644
--- a/bitbake/lib/bb/server/process.py
+++ b/bitbake/lib/bb/server/process.py
@@ -303,19 +303,10 @@ class ServerCommunicator():
303 self.recv = recv 303 self.recv = recv
304 304
305 def runCommand(self, command): 305 def runCommand(self, command):
306
307 self.connection.send(command) 306 self.connection.send(command)
308 while True: 307 if not self.recv.poll(5):
309 # don't let the user ctrl-c while we're waiting for a response 308 raise ProcessTimeout("Timeout while waiting for a reply from the bitbake server")
310 try: 309 return self.recv.get()
311 for idx in range(0,4): # 0, 1, 2, 3
312 if self.recv.poll(1):
313 return self.recv.get()
314 else:
315 bb.note("Timeout while attempting to communicate with bitbake server, retrying...")
316 raise ProcessTimeout("Gave up; Too many tries: timeout while attempting to communicate with bitbake server")
317 except KeyboardInterrupt:
318 pass
319 310
320 def updateFeatureSet(self, featureset): 311 def updateFeatureSet(self, featureset):
321 _, error = self.runCommand(["setFeatures", featureset]) 312 _, error = self.runCommand(["setFeatures", featureset])