[oe-commits] [bitbake] 01/06: server/process: Fix unclosed socket warnings upon server connection refused

git at git.openembedded.org git at git.openembedded.org
Thu Dec 6 10:51:43 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch 1.38
in repository bitbake.

commit 115919f0c11e22df783348422e06ab95f5c943e1
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Tue Nov 6 11:36:27 2018 +0000

    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...
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/server/process.py | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py
index 828159e..2246d95 100644
--- a/lib/bb/server/process.py
+++ b/lib/bb/server/process.py
@@ -452,15 +452,14 @@ def connectProcessServer(sockname, featureset):
     cwd = os.getcwd()
 
     try:
-        os.chdir(os.path.dirname(sockname))
-        sock.connect(os.path.basename(sockname))
-    finally:
-        os.chdir(cwd)
-
-    readfd = writefd = readfd1 = writefd1 = readfd2 = writefd2 = None
-    eq = command_chan_recv = command_chan = None
+        try:
+            os.chdir(os.path.dirname(sockname))
+            sock.connect(os.path.basename(sockname))
+        finally:
+            os.chdir(cwd)
 
-    try:
+        readfd = writefd = readfd1 = writefd1 = readfd2 = writefd2 = None
+        eq = command_chan_recv = command_chan = None
 
         # Send an fd for the remote to write events to
         readfd, writefd = os.pipe()

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list