aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-12-24 16:32:18 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-02-25 22:20:12 +0000
commitf770d6a332812031682dc6bef1a2a84da52a4c32 (patch)
tree7f756ebb280b53ba43b8b0a9a6755802c7d65a87
parentc4a940991f261959eb08273d2250d3866b868938 (diff)
downloadbitbake-f770d6a332812031682dc6bef1a2a84da52a4c32.tar.gz
process: Handle EWOULDBLOCK in socket connect
Now that we set a timeout for the socket, it can return EWOULDBLOCK if a signal or other event happens to wake up even if we don't timeout. If this happens, retry the connection, else we simply see it quickly loop through the retries and abort the connection in a very short interval. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/server/process.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py
index 01a4b3030..49a1b7c14 100644
--- a/lib/bb/server/process.py
+++ b/lib/bb/server/process.py
@@ -478,7 +478,14 @@ def connectProcessServer(sockname, featureset):
try:
try:
os.chdir(os.path.dirname(sockname))
- sock.connect(os.path.basename(sockname))
+ finished = False
+ while not finished:
+ try:
+ sock.connect(os.path.basename(sockname))
+ finished = True
+ except IOError as e:
+ if e.errno == errno.EWOULDBLOCK:
+ pass
finally:
os.chdir(cwd)