summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-11-06 11:36:27 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-11-07 23:08:55 +0000
commit0814e48a0812a739ac59b76a4592465b718b5030 (patch)
tree2a8e92372ab79a67f74af578dc821b34fa7f854d /bitbake/lib
parentb8e08c65192c79244d0dff2bf81c5797d4ef2a36 (diff)
downloadpoky-0814e48a0812a739ac59b76a4592465b718b5030.tar.gz
bitbake: server/process: Fix unclosed socket warnings upon server connection refused
Extend the server error handling to avoid: Reconnecting to bitbake server... NOTE: Retrying server connection... (Traceback (most recent call last): File "/home/pokybuild/yocto-worker/nightly-oe-selftest/build/bitbake/lib/bb/main.py", line 464, in setup_bitbake server_connection = bb.server.process.connectProcessServer(sockname, featureset) File "/home/pokybuild/yocto-worker/nightly-oe-selftest/build/bitbake/lib/bb/server/process.py", line 457, in connectProcessServer sock.connect(os.path.basename(sockname)) ConnectionRefusedError: [Errno 111] Connection refused ) WARNING: /home/pokybuild/yocto-worker/nightly-oe-selftest/build/bitbake/lib/bb/main.py:481: ResourceWarning: unclosed <socket.socket fd=20, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0> logger.info("Retrying server connection... (%s)" % traceback.format_exc()) NOTE: Starting bitbake server... (Bitbake rev: afee3f594e1510051a0b18e430e92549caf72fa2) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/server/process.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py
index 38b923fe2d..ed930c61f4 100644
--- a/bitbake/lib/bb/server/process.py
+++ b/bitbake/lib/bb/server/process.py
@@ -453,15 +453,14 @@ def connectProcessServer(sockname, featureset):
453 cwd = os.getcwd() 453 cwd = os.getcwd()
454 454
455 try: 455 try:
456 os.chdir(os.path.dirname(sockname)) 456 try:
457 sock.connect(os.path.basename(sockname)) 457 os.chdir(os.path.dirname(sockname))
458 finally: 458 sock.connect(os.path.basename(sockname))
459 os.chdir(cwd) 459 finally:
460 460 os.chdir(cwd)
461 readfd = writefd = readfd1 = writefd1 = readfd2 = writefd2 = None
462 eq = command_chan_recv = command_chan = None
463 461
464 try: 462 readfd = writefd = readfd1 = writefd1 = readfd2 = writefd2 = None
463 eq = command_chan_recv = command_chan = None
465 464
466 # Send an fd for the remote to write events to 465 # Send an fd for the remote to write events to
467 readfd, writefd = os.pipe() 466 readfd, writefd = os.pipe()