You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by jd...@apache.org on 2021/07/23 17:20:43 UTC

[qpid-dispatch] branch main updated (4746fb3 -> 8bb0e74)

This is an automated email from the ASF dual-hosted git repository.

jdanek pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git.


    from 4746fb3  DISPATCH-2168: Added addr incref and decref for no_route links. This will make sure that the address object will not be freed prematurely. This closes #1304
     new 7aab3f3  DISPATCH-1619 Close connections created in system_test by wait_router_connected
     new 8bb0e74  DISPATCH-2119 Close connection if Node creation fails, to prevent fd leaks on macOS

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 python/qpid_dispatch/management/client.py |  9 +++++++--
 tests/system_test.py                      | 13 +++++++++++--
 tests/system_tests_qdmanage.py            |  2 +-
 3 files changed, 19 insertions(+), 5 deletions(-)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[qpid-dispatch] 02/02: DISPATCH-2119 Close connection if Node creation fails, to prevent fd leaks on macOS

Posted by jd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jdanek pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git

commit 8bb0e74e9ab4d152a11759aa032b134241aaccd5
Author: Jiri Danek <jd...@redhat.com>
AuthorDate: Thu Jul 22 14:52:43 2021 +0200

    DISPATCH-2119 Close connection if Node creation fails, to prevent fd leaks on macOS
---
 python/qpid_dispatch/management/client.py | 9 +++++++--
 tests/system_test.py                      | 9 +++++++--
 tests/system_tests_qdmanage.py            | 2 +-
 3 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/python/qpid_dispatch/management/client.py b/python/qpid_dispatch/management/client.py
index a36d798..9c81cd1 100644
--- a/python/qpid_dispatch/management/client.py
+++ b/python/qpid_dispatch/management/client.py
@@ -122,8 +122,13 @@ class Node(object):
             path = '_edge/%s/$management' % edge_router
         else:
             path = '$management'
-        return Node(Node.connection(url, router, timeout, ssl_domain, sasl,
-                                    edge_router=edge_router), path)
+        connection = Node.connection(url, router, timeout, ssl_domain, sasl, edge_router=edge_router)
+        try:
+            return Node(connection, path)
+        except Exception:
+            # ownership of connection has not been given to a new Node; close the connection
+            connection.close()
+            raise
 
     def __init__(self, connection, path, locales=None):
         """
diff --git a/tests/system_test.py b/tests/system_test.py
index 5e7697e..08c96ae 100755
--- a/tests/system_test.py
+++ b/tests/system_test.py
@@ -51,13 +51,15 @@ import uuid
 
 import unittest
 
+import proton
+import proton.utils
 from proton import Message
 from proton import Delivery
 from proton.handlers import MessagingHandler
 from proton.reactor import AtLeastOnce, Container
 from proton.reactor import AtMostOnce
 from qpid_dispatch.management.client import Node
-
+from qpid_dispatch.management.error import NotFoundStatus
 
 # Optional modules
 MISSING_MODULES = []
@@ -704,7 +706,10 @@ class Qdrouterd(Process):
             # Meantime the following actually tests send-thru to the router.
             node = Node.connect(self.addresses[0], router_id, timeout=1)
             return retry_exception(lambda: node.query('org.apache.qpid.dispatch.router'))
-        except:
+        except (proton.ConnectionException, NotFoundStatus, proton.utils.LinkDetached):
+            # proton.ConnectionException: the router is not yet accepting connections
+            # NotFoundStatus: the queried router is not yet connected
+            # TODO(DISPATCH-2119) proton.utils.LinkDetached: should be removed, currently needed for DISPATCH-2033
             return False
         finally:
             if node:
diff --git a/tests/system_tests_qdmanage.py b/tests/system_tests_qdmanage.py
index 7dd0f8f..28b412e 100644
--- a/tests/system_tests_qdmanage.py
+++ b/tests/system_tests_qdmanage.py
@@ -100,7 +100,7 @@ class QdmanageTest(TestCase):
         return out
 
     def assert_entity_equal(self, expect, actual, copy=None):
-        """Copy keys in copy from actual to identity, then assert maps equal."""
+        """Copy keys in copy from actual to expect, then assert maps equal."""
         if copy:
             for k in copy:
                 expect[k] = actual[k]

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[qpid-dispatch] 01/02: DISPATCH-1619 Close connections created in system_test by wait_router_connected

Posted by jd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jdanek pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git

commit 7aab3f37f20a356d475af0ac9b0397b15a24d6e8
Author: Jiri Daněk <jd...@redhat.com>
AuthorDate: Tue Jun 29 11:37:26 2021 +0200

    DISPATCH-1619 Close connections created in system_test by wait_router_connected
---
 tests/system_test.py           | 4 ++++
 tests/system_tests_qdmanage.py | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/tests/system_test.py b/tests/system_test.py
index 94a6613..5e7697e 100755
--- a/tests/system_test.py
+++ b/tests/system_test.py
@@ -694,6 +694,7 @@ class Qdrouterd(Process):
         return self
 
     def is_router_connected(self, router_id, **retry_kwargs):
+        node = None
         try:
             self.management.read(identity="router.node/%s" % router_id)
             # TODO aconway 2015-01-29: The above check should be enough, we
@@ -705,6 +706,9 @@ class Qdrouterd(Process):
             return retry_exception(lambda: node.query('org.apache.qpid.dispatch.router'))
         except:
             return False
+        finally:
+            if node:
+                node.close()
 
     def wait_router_connected(self, router_id, **retry_kwargs):
         retry(lambda: self.is_router_connected(router_id), **retry_kwargs)
diff --git a/tests/system_tests_qdmanage.py b/tests/system_tests_qdmanage.py
index bf7ba39..7dd0f8f 100644
--- a/tests/system_tests_qdmanage.py
+++ b/tests/system_tests_qdmanage.py
@@ -100,7 +100,7 @@ class QdmanageTest(TestCase):
         return out
 
     def assert_entity_equal(self, expect, actual, copy=None):
-        """Copy keys in copy from actual to idenity, then assert maps equal."""
+        """Copy keys in copy from actual to identity, then assert maps equal."""
         if copy:
             for k in copy:
                 expect[k] = actual[k]

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org