Skip to contentSkip to conversation

process: log odd unlink events with bitbake.sock

PATCH New Frank de Brabander 1 participant 1 message Dec 14, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 process: log odd unlink events with bitbake.sock

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

Log when unlinking the socket file failed.

---
 lib/bb/server/process.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
lib/bb/server/process.py +3 -2
index 44c65451..12498a6c 100644
@@ -278,8 +278,8 @@ class ProcessServer():
         # Remove the socket file so we don't get any more connections to avoid races
         try:
             os.unlink(self.sockname)
-        except:
-            pass
+        except Exception as err:
+            serverlog("Removing socket file '%s' failed (%s)" % (self.sockname, err))
         self.sock.close()
 
         try:
@@ -543,6 +543,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)
             os.unlink(sockname)
 
         sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
Signature · 1 line
2.20.1