Skip to contentSkip to conversation

server/process: Ensure socket has a timeout set

PATCH New Richard Purdie 1 participant 1 message Dec 14, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 server/process: Ensure socket has a timeout set

We're seeing hangs in oe-selftest where server startup and shutdown are racing. The assumption was a connect would timeout however no timeout is set which can leave processes hanging. Set a short timeout for the connection to avoid this.

---
 lib/bb/server/process.py | 2 ++
 1 file changed, 2 insertions(+)
lib/bb/server/process.py +2 -0
index 1a6a826746..f7d07266cf 100644
@@ -474,6 +474,8 @@ def connectProcessServer(sockname, featureset):
     readfd = writefd = readfd1 = writefd1 = readfd2 = writefd2 = None
     eq = command_chan_recv = command_chan = None
 
+    sock.settimeout(2)
+
     try:
         try:
             os.chdir(os.path.dirname(sockname))
Signature · 1 line
2.19.1