summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-08-08 20:55:21 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-08-09 10:55:24 +0100
commit2bc47e887c3b41417edaa89a8708c223fd2085de (patch)
tree174d6051793e0d4ac312b68bbad1343684608e20
parente4c6ca9440f63761560b49bbe12654441f54687e (diff)
downloadbitbake-contrib-2bc47e887c3b41417edaa89a8708c223fd2085de.tar.gz
bitbake-contrib-2bc47e887c3b41417edaa89a8708c223fd2085de.tar.bz2
bitbake-contrib-2bc47e887c3b41417edaa89a8708c223fd2085de.zip
server/process: Ensure we don't loop on client EOFError
The server currently crashes if we hit an EOFError due to controllersock still being in ready and the continue meaning ready isn't re-evaluated. Setting the value to False can mean the shutdown code doesn't handle the situation cleanly. Clear ready to avoid the crash/loop instead and handle any OSError whilst we're in here. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/server/process.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py
index 338c44835e..ee8b14ea7d 100644
--- a/lib/bb/server/process.py
+++ b/lib/bb/server/process.py
@@ -164,7 +164,7 @@ class ProcessServer(multiprocessing.Process):
self.haveui = True
- except EOFError:
+ except (EOFError, OSError):
print("Disconnecting Client")
fds.remove(self.controllersock)
fds.remove(self.command_channel)
@@ -190,7 +190,7 @@ class ProcessServer(multiprocessing.Process):
command = self.command_channel.get()
except EOFError:
# Client connection shutting down
- self.command_channel = False
+ ready = []
continue
if command[0] == "terminateServer":
self.quit = True