[bitbake-devel] [WIP][RFC PATCH 3/5] bitbake: process: fix disconnect when BB_SERVER_TIMEOUT

Robert Yang liezhi.yang at windriver.com
Tue Aug 8 09:12:07 UTC 2017


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 at windriver.com>
---
 bitbake/lib/bb/server/process.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py
index bfd6404b738..5b8a549f94e 100644
--- a/bitbake/lib/bb/server/process.py
+++ b/bitbake/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
-- 
2.11.0




More information about the bitbake-devel mailing list