summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/server
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-08-23 15:46:00 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-08-24 13:48:40 +0100
commit2b453483d4610945c6156cc7f472ffae803cb28a (patch)
tree668542757ac62186938dd697eb920514b440413c /bitbake/lib/bb/server
parent95b99811bb51fba6a03dfa60a5b85e821550193e (diff)
downloadpoky-2b453483d4610945c6156cc7f472ffae803cb28a.tar.gz
bitbake: process: Clean up connection retry logic
Its possible for a connection to connect to the server as its shutting down but before its removed the socket file. This patch: a) Removes the socket file earlier to avoid connections. b) Handles EOFError in initial connections gracefully. These occur if the socket is closed during the server shutdown. c) Ensure duplicate events aren't shown on the console. This makes debugging these issues very very confusing. With these changes the backtrace that was concerning users is hidden and the server works as expected with a reconnect when it catches it in a bad state. (Bitbake rev: f45196cf84669723382730944dddc7eaf50826f2) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/server')
-rw-r--r--bitbake/lib/bb/server/process.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py
index 3ab793c778..fad8aac4da 100644
--- a/bitbake/lib/bb/server/process.py
+++ b/bitbake/lib/bb/server/process.py
@@ -215,6 +215,10 @@ class ProcessServer(multiprocessing.Process):
215 ready = self.idle_commands(.1, fds) 215 ready = self.idle_commands(.1, fds)
216 216
217 print("Exiting") 217 print("Exiting")
218 # Remove the socket file so we don't get any more connections to avoid races
219 os.unlink(self.sockname)
220 self.sock.close()
221
218 try: 222 try:
219 self.cooker.shutdown(True) 223 self.cooker.shutdown(True)
220 except: 224 except:
@@ -222,10 +226,6 @@ class ProcessServer(multiprocessing.Process):
222 226
223 self.cooker.post_serve() 227 self.cooker.post_serve()
224 228
225 # Remove the socket file so we don't get any more connections to avoid races
226 os.unlink(self.sockname)
227 self.sock.close()
228
229 # Finally release the lockfile but warn about other processes holding it open 229 # Finally release the lockfile but warn about other processes holding it open
230 lock = self.bitbake_lock 230 lock = self.bitbake_lock
231 lockfile = lock.name 231 lockfile = lock.name