BIND 10 master, updated. 88e7a72ae29daf1dfd87cd4fb6ae31bbc6fb9684 Merge #2888

BIND 10 source code commits bind10-changes at lists.isc.org
Tue Apr 9 13:16:20 UTC 2013


The branch, master has been updated
       via  88e7a72ae29daf1dfd87cd4fb6ae31bbc6fb9684 (commit)
       via  bd65ec46d25bb56ab77f50ebf8d6e431fda2d478 (commit)
       via  f5f3e572144232518b47dba3ed32a6cded151a47 (commit)
      from  0d8a7d1e48a1b1df5fc09a65bacd550a4bba6d00 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 88e7a72ae29daf1dfd87cd4fb6ae31bbc6fb9684
Merge: 0d8a7d1 bd65ec4
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Tue Apr 9 15:14:53 2013 +0200

    Merge #2888
    
    Fix failure to connect in msgq tests.

-----------------------------------------------------------------------

Summary of changes:
 src/bin/msgq/tests/msgq_run_test.py |   17 +++++++++++++----
 src/lib/python/isc/cc/session.py    |    4 +++-
 2 files changed, 16 insertions(+), 5 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/bin/msgq/tests/msgq_run_test.py b/src/bin/msgq/tests/msgq_run_test.py
index 8e8cb65..95173e0 100644
--- a/src/bin/msgq/tests/msgq_run_test.py
+++ b/src/bin/msgq/tests/msgq_run_test.py
@@ -72,12 +72,21 @@ class MsgqRunTest(unittest.TestCase):
         # Start msgq
         self.__msgq = subprocess.Popen([MSGQ_PATH, '-s', SOCKET_PATH],
                                        close_fds=True)
-        # Wait for it to become ready (up to the alarm-set timeout)
-        while not os.path.exists(SOCKET_PATH):
-            # Just a short wait, so we don't hog CPU, but don't wait too long
-            time.sleep(0.01)
         # Some testing data
         self.__no_recpt = {"result": [-1, "No such recipient"]}
+        # Wait for it to become ready (up to the alarm-set timeout)
+        connection = None
+        while not connection:
+            try:
+                # If the msgq is ready, this'll succeed. If not, it'll throw
+                # session error.
+                connection = isc.cc.session.Session(SOCKET_PATH)
+            except isc.cc.session.SessionError:
+                time.sleep(0.1) # Retry after a short time
+        # We have the connection now, that means it works. Close this
+        # connection, we won't use it. Each test gets enough new connections
+        # of its own.
+        connection.close()
 
     def __message(self, data):
         """
diff --git a/src/lib/python/isc/cc/session.py b/src/lib/python/isc/cc/session.py
index fced424..636dd08 100644
--- a/src/lib/python/isc/cc/session.py
+++ b/src/lib/python/isc/cc/session.py
@@ -67,7 +67,9 @@ class Session:
             logger.debug(logger.DBGLVL_TRACE_BASIC, PYCC_LNAME_RECEIVED,
                          self._lname)
         except socket.error as se:
-                raise SessionError(se)
+            if self._socket:
+                self._socket.close()
+            raise SessionError(se)
 
     @property
     def lname(self):



More information about the bind10-changes mailing list