diff mbox series

[langdale,2.2,1/2] process: log odd unlink events with bitbake.sock

Message ID ec6fd61498b017c353a1a01afcb4b897ca4a2f95.1673705296.git.steve@sakoman.com
State New
Headers show
Series [langdale,2.2,1/2] process: log odd unlink events with bitbake.sock | expand

Commit Message

Steve Sakoman Jan. 14, 2023, 2:12 p.m. UTC
From: Frank de Brabander <debrabander@gmail.com>

Log when the socket file already exists and is removed before
recreating a new socket.

Log when unlinking the socket file failed.

Signed-off-by: Frank de Brabander <debrabander@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit cfd7c9899f988bab6d9fe7bbfbdb60603fb5ed34)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
 lib/bb/server/process.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series


diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py
index 5d02c0b9..2a9fb662 100644
--- a/lib/bb/server/process.py
+++ b/lib/bb/server/process.py
@@ -248,8 +248,8 @@  class ProcessServer():
         # Remove the socket file so we don't get any more connections to avoid races
-        except:
-            pass
+        except Exception as err:
+            serverlog("Removing socket file '%s' failed (%s)" % (self.sockname, err))
@@ -532,6 +532,7 @@  def execServer(lockfd, readypipeinfd, lockname, sockname, server_timeout, xmlrpc
         # Create server control socket
         if os.path.exists(sockname):
+            serverlog("WARNING: removing existing socket file '%s'" % sockname)
         sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)