summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2017-08-08 02:12:07 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-08-08 13:15:18 +0100
commit7b739a38601b053d9bea4df2c0b44a952ab670c4 (patch)
tree23e4e163b3938affa57c97e863c353c01551d010 /lib
parent7a4ea1e6a10f20d80009a78f4f0aebf8f90095fd (diff)
downloadbitbake-contrib-7b739a38601b053d9bea4df2c0b44a952ab670c4.tar.gz
process: Fix disconnect when BB_SERVER_TIMEOUT
Fixed: $ export BB_SERVER_TIMEOUT=10000 $ bitbake --server-only $ bitbake --status-only [snip] File "/buildarea/lyang1/poky/bitbake/lib/bb/server/process.py", line 472, in recvfds msg, ancdata, flags, addr = sock.recvmsg(1, socket.CMSG_LEN(bytes_size)) OSError: [Errno 9] Bad file descriptor And: $ export BB_SERVER_TIMEOUT=10000 $ bitbake --server-only -B localhost:-1 $ bitbake --status-only # Everything is fine in first run $ bitbake --status-only [snip] File "/buildarea/lyang1/poky/bitbake/lib/bb/server/process.py", line 472, in recvfds msg, ancdata, flags, addr = sock.recvmsg(1, socket.CMSG_LEN(bytes_size)) OSError: [Errno 9] Bad file descriptor This was because self.controllersock was not set to False, so it still ran sock.recvmsg() when sock was closed. And also need set command_channel to Flase, otherwise the self.command_channel.get() will always run when EOF, and cause infinite loop. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/bb/server/process.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py
index bfd6404b7..5b8a549f9 100644
--- a/lib/bb/server/process.py
+++ b/lib/bb/server/process.py
@@ -173,6 +173,7 @@ class ProcessServer(multiprocessing.Process):
self.event_writer.writer.close()
del self.event_writer
self.controllersock.close()
+ self.controllersock = False
self.haveui = False
self.lastui = time.time()
self.cooker.clientComplete()
@@ -188,6 +189,7 @@ class ProcessServer(multiprocessing.Process):
command = self.command_channel.get()
except EOFError:
# Client connection shutting down
+ self.command_channel = False
continue
if command[0] == "terminateServer":
self.quit = True