You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by tr...@apache.org on 2016/01/26 23:08:41 UTC

qpid-dispatch git commit: DISPATCH-208 - Added a test to detect improper "closest" forwarding. Fixed a problem with the format of addresses learned from remote routers being compared to the configuration and mismatching, re

Repository: qpid-dispatch
Updated Branches:
  refs/heads/master bce05297a -> 197e49a25


DISPATCH-208 - Added a test to detect improper "closest" forwarding.  Fixed a problem with
               the format of addresses learned from remote routers being compared to the
               configuration and mismatching, resulting in incorrect semantics.


Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/197e49a2
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/197e49a2
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/197e49a2

Branch: refs/heads/master
Commit: 197e49a2511d8c1790f675fe3f0618c1708c83c5
Parents: bce0529
Author: Ted Ross <tr...@redhat.com>
Authored: Tue Jan 26 17:07:10 2016 -0500
Committer: Ted Ross <tr...@redhat.com>
Committed: Tue Jan 26 17:07:10 2016 -0500

----------------------------------------------------------------------
 src/router_pynode.c               |  6 +++++-
 tests/system_tests_two_routers.py | 21 +++++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/197e49a2/src/router_pynode.c
----------------------------------------------------------------------
diff --git a/src/router_pynode.c b/src/router_pynode.c
index 2003779..e54294a 100644
--- a/src/router_pynode.c
+++ b/src/router_pynode.c
@@ -461,7 +461,11 @@ static PyObject* qd_map_destination(PyObject *self, PyObject *args)
     sys_mutex_lock(router->lock);
     qd_hash_retrieve(router->addr_hash, iter, (void**) &addr);
     if (!addr) {
-        addr = qd_address(router_semantics_for_addr(router, iter, phase, &unused));
+        const char *sem_addr = addr_string;
+        sem_addr += *sem_addr == 'M' ? 2 : 1;
+        qd_field_iterator_t *sem_iter = qd_address_iterator_string(sem_addr, ITER_VIEW_ALL);
+        addr = qd_address(router_semantics_for_addr(router, sem_iter, phase, &unused));
+        qd_field_iterator_free(sem_iter);
         qd_hash_insert(router->addr_hash, iter, addr, &addr->hash_handle);
         DEQ_ITEM_INIT(addr);
         DEQ_INSERT_TAIL(router->addrs, addr);

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/197e49a2/tests/system_tests_two_routers.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_two_routers.py b/tests/system_tests_two_routers.py
index 835acce..5605f45 100644
--- a/tests/system_tests_two_routers.py
+++ b/tests/system_tests_two_routers.py
@@ -860,6 +860,10 @@ class RouterTest(TestCase):
         M3 = self.messenger()
         M4 = self.messenger()
 
+        M2.timeout = 0.1
+        M3.timeout = 0.1
+        M4.timeout = 0.1
+
         M1.route("amqp:/*", self.routers[0].addresses[0]+"/$1")
         M2.route("amqp:/*", self.routers[1].addresses[0]+"/$1")
         M3.route("amqp:/*", self.routers[0].addresses[0]+"/$1")
@@ -871,6 +875,7 @@ class RouterTest(TestCase):
         M4.start()
 
         M2.subscribe(addr)
+        self.routers[0].wait_address("closest/1", 0, 1)
         M3.subscribe(addr)
         M4.subscribe(addr)
         self.routers[0].wait_address("closest/1", 1, 1)
@@ -891,6 +896,22 @@ class RouterTest(TestCase):
             M3.get(rm)
             rx_set.append(rm.body['number'])
 
+        try:
+            M2.recv(1)
+            self.assertEqual(0, "Unexpected messages arrived on M2")
+        except AssertionError:
+            raise
+        except Exception:
+            pass
+
+        try:
+            M4.recv(1)
+            self.assertEqual(0, "Unexpected messages arrived on M4")
+        except AssertionError:
+            raise
+        except Exception:
+            pass
+
         self.assertEqual(30, len(rx_set))
         rx_set.sort()
         for i in range(30):


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