summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-12-13 23:16:02 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-12-13 23:26:28 +0000
commit77a9c9b66b26563729d35f8f7ee957d623659fe8 (patch)
treefe873b3000747f0980c918df888b192a9bab49cc
parent9c36aef6102a691b8cc5fdc43f7f24bb7fe665db (diff)
downloadpoky-77a9c9b66b26563729d35f8f7ee957d623659fe8.tar.gz
bitbake: main/process: Add extra sockname debugging
We're struggling to understand how bitbake.sock can sometimes disappear in live builds when we can't see where it could have been deleted. This causes connection failures to the server and failed builds. Add some extra debugging around the server log and client retry log messages to give more information for the next time this issue occurs. (Bitbake rev: 376a516dc8c96727fd042ada65f803013601ee2d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xbitbake/lib/bb/main.py3
-rw-r--r--bitbake/lib/bb/server/process.py7
2 files changed, 6 insertions, 4 deletions
diff --git a/bitbake/lib/bb/main.py b/bitbake/lib/bb/main.py
index 1e38d04bcf..f1ea7859da 100755
--- a/bitbake/lib/bb/main.py
+++ b/bitbake/lib/bb/main.py
@@ -441,7 +441,8 @@ def setup_bitbake(configParams, extrafeatures=None):
441 logger.info("Previous bitbake instance shutting down?, waiting to retry... (%s)" % timestamp()) 441 logger.info("Previous bitbake instance shutting down?, waiting to retry... (%s)" % timestamp())
442 procs = bb.server.process.get_lockfile_process_msg(lockfile) 442 procs = bb.server.process.get_lockfile_process_msg(lockfile)
443 if procs: 443 if procs:
444 logger.info("Processes holding bitbake.lock:\n%s" % procs) 444 logger.info("Processes holding bitbake.lock (missing socket %s):\n%s" % (sockname, procs))
445 logger.info("Directory listing: %s" % (str(os.listdir(topdir))))
445 i = 0 446 i = 0
446 lock = None 447 lock = None
447 # Wait for 5s or until we can get the lock 448 # Wait for 5s or until we can get the lock
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py
index f4ab80ba67..44c65451fc 100644
--- a/bitbake/lib/bb/server/process.py
+++ b/bitbake/lib/bb/server/process.py
@@ -154,9 +154,10 @@ class ProcessServer():
154 fds.append(self.xmlrpc) 154 fds.append(self.xmlrpc)
155 seendata = False 155 seendata = False
156 serverlog("Entering server connection loop") 156 serverlog("Entering server connection loop")
157 serverlog("Lockfile is: %s\nSocket is %s (%s)" % (self.bitbake_lock_name, self.sockname, os.path.exists(self.sockname)))
157 158
158 def disconnect_client(self, fds): 159 def disconnect_client(self, fds):
159 serverlog("Disconnecting Client") 160 serverlog("Disconnecting Client (socket: %s)" % os.path.exists(self.sockname))
160 if self.controllersock: 161 if self.controllersock:
161 fds.remove(self.controllersock) 162 fds.remove(self.controllersock)
162 self.controllersock.close() 163 self.controllersock.close()
@@ -246,7 +247,7 @@ class ProcessServer():
246 try: 247 try:
247 serverlog("Running command %s" % command) 248 serverlog("Running command %s" % command)
248 self.command_channel_reply.send(self.cooker.command.runCommand(command)) 249 self.command_channel_reply.send(self.cooker.command.runCommand(command))
249 serverlog("Command Completed") 250 serverlog("Command Completed (socket: %s)" % os.path.exists(self.sockname))
250 except Exception as e: 251 except Exception as e:
251 stack = traceback.format_exc() 252 stack = traceback.format_exc()
252 serverlog('Exception in server main event loop running command %s (%s)' % (command, stack)) 253 serverlog('Exception in server main event loop running command %s (%s)' % (command, stack))
@@ -273,7 +274,7 @@ class ProcessServer():
273 274
274 ready = self.idle_commands(.1, fds) 275 ready = self.idle_commands(.1, fds)
275 276
276 serverlog("Exiting") 277 serverlog("Exiting (socket: %s)" % os.path.exists(self.sockname))
277 # Remove the socket file so we don't get any more connections to avoid races 278 # Remove the socket file so we don't get any more connections to avoid races
278 try: 279 try:
279 os.unlink(self.sockname) 280 os.unlink(self.sockname)