summaryrefslogtreecommitdiffstats
path: root/lib/bb/server/process.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-11-28 16:30:12 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-12-01 11:31:37 +0000
commit6998fd816ceb0034c852a8fb994901fdf1975cfd (patch)
tree9af63b0b81223a0a79d1370c400398b146d1d68a /lib/bb/server/process.py
parent2f0b6cea2be7e89ef01181b10899b3e7f11e8f20 (diff)
downloadbitbake-6998fd816ceb0034c852a8fb994901fdf1975cfd.tar.gz
server/process: Fix ConnectionRefusedError tracebacks
Improve connetion refused error handling: NOTE: Retrying server connection... NOTE: Reconnecting to bitbake server... NOTE: Retrying server connection... (Traceback (most recent call last): File "/home/pokybuild/yocto-worker/oe-selftest-opensuse/build/bitbake/lib/bb/server/process.py", line 471, in connectProcessServer sock.connect(os.path.basename(sockname)) ConnectionRefusedError: [Errno 111] Connection refused During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/pokybuild/yocto-worker/oe-selftest-opensuse/build/bitbake/lib/bb/main.py", line 464, in setup_bitbake server_connection = bb.server.process.connectProcessServer(sockname, featureset) File "/home/pokybuild/yocto-worker/oe-selftest-opensuse/build/bitbake/lib/bb/server/process.py", line 502, in connectProcessServer os.close(i) TypeError: an integer is required (got type NoneType) ) WARNING: /home/pokybuild/yocto-worker/oe-selftest-opensuse/build/bitbake/lib/bb/main.py:481: ResourceWarning: unclosed <socket.socket fd=14, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0> logger.info("Retrying server connection... (%s)" % traceback.format_exc()) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/server/process.py')
-rw-r--r--lib/bb/server/process.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py
index efb433239..81617acd9 100644
--- a/lib/bb/server/process.py
+++ b/lib/bb/server/process.py
@@ -499,7 +499,8 @@ def connectProcessServer(sockname, featureset):
command_chan.close()
for i in [writefd, readfd1, writefd2]:
try:
- os.close(i)
+ if i:
+ os.close(i)
except OSError:
pass
sock.close()