You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by gm...@apache.org on 2018/04/03 13:48:43 UTC

qpid-dispatch git commit: DISPATCH-918 - Deprecated some router attributes and introduced replacements with much clearer names

Repository: qpid-dispatch
Updated Branches:
  refs/heads/master fc7ed088a -> 535afa8dd


DISPATCH-918 - Deprecated some router attributes and introduced replacements with much clearer names


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

Branch: refs/heads/master
Commit: 535afa8dd1c910d6269efc2d320cd2abf3154d19
Parents: fc7ed08
Author: Ganesh Murthy <gm...@redhat.com>
Authored: Tue Apr 3 09:46:45 2018 -0400
Committer: Ganesh Murthy <gm...@redhat.com>
Committed: Tue Apr 3 09:46:45 2018 -0400

----------------------------------------------------------------------
 doc/new-book/configuration-reference.adoc     | 12 ++++++------
 doc/new-book/configuration-security.adoc      |  6 +++---
 doc/new-book/managing-using-qdmanage.adoc     |  4 ++--
 etc/sasl2/qdrouterd.conf                      |  2 +-
 python/qpid_dispatch/management/qdrouter.json | 21 ++++++++++++++-------
 python/qpid_dispatch_internal/router/hello.py |  4 ++--
 python/qpid_dispatch_internal/router/link.py  |  4 ++--
 python/qpid_dispatch_internal/router/node.py  |  6 +++---
 src/dispatch.c                                |  2 +-
 tests/router_engine_test.py                   |  8 ++++----
 tests/system_tests_one_router.py              | 12 ++++++------
 tests/system_tests_sasl_plain.py              |  7 ++++---
 tests/system_tests_two_routers.py             |  5 ++++-
 13 files changed, 52 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/535afa8d/doc/new-book/configuration-reference.adoc
----------------------------------------------------------------------
diff --git a/doc/new-book/configuration-reference.adoc b/doc/new-book/configuration-reference.adoc
index 1880d93..197f22d 100644
--- a/doc/new-book/configuration-reference.adoc
+++ b/doc/new-book/configuration-reference.adoc
@@ -92,14 +92,14 @@ Describe main information about the router related to identity, internal process
 
 * *_id_* (string) : Router’s unique identity. It is required and the router will fail to start without it.
 * *_mode_* (One of [`standalone`, `interior`], default=`standalone`) : In standalone mode, the router operates as a single component. It does not participate in the routing protocol and therefore will not cooperate with other routers. In interior mode, the router operates in cooperation with other interior routers in an interconnected network.
-* *_helloInterval_* (integer, default=`1`) : Interval in seconds between HELLO messages sent to neighbor routers in order to announce its presence (as a keep alive).
-* *_helloMaxAge_* (integer, default=`3`) : Time in seconds after which a neighbor router is declared lost if no HELLO is received.
-* *_raInterval_* (integer, default=`30`) : Interval in seconds between Router-Advertisements sent to all routers in a stable network.
-* *_raIntervalFlux_* (integer, default=`4`) : Interval in seconds between Router-Advertisements sent to all routers during topology fluctuations.
-* *_remoteLsMaxAge_* (integer, default=`60`) : Time in seconds after which link state is declared stale if no RA is received.
+* *_helloIntervalSeconds_* (integer, default=`1`) : Interval in seconds between HELLO messages sent to neighbor routers in order to announce its presence (as a keep alive).
+* *_helloMaxAgeSeconds_* (integer, default=`3`) : Time in seconds after which a neighbor router is declared lost if no HELLO is received.
+* *_raIntervalSeconds_* (integer, default=`30`) : Interval in seconds between Router-Advertisements sent to all routers in a stable network.
+* *_raIntervalFluxSeconds_* (integer, default=`4`) : Interval in seconds between Router-Advertisements sent to all routers during topology fluctuations.
+* *_remoteLsMaxAgeSeconds_* (integer, default=`60`) : Time in seconds after which link state is declared stale if no RA is received.
 * *_workerThreads_* (integer, default=`4`) : The number of threads that will be created to process message traffic and other application work (timers, non-amqp file descriptors, and so on).
 * *_debugDump_* (path) : The absolute path for a file to dump debugging information that can’t be logged normally.
-* *_saslConfigPath_* (path) : The absolute path to the SASL configuration file.
+* *_saslConfigDir_* (path) : The absolute path to the SASL configuration file.
 * *_saslConfigName_* (string, default=`qdrouterd`) : Name of the SASL configuration. This string + ‘.conf’ is the name of the configuration file.
 
 [id='router-configuration-file-listener']

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/535afa8d/doc/new-book/configuration-security.adoc
----------------------------------------------------------------------
diff --git a/doc/new-book/configuration-security.adoc b/doc/new-book/configuration-security.adoc
index 2cdcec4..be0c261 100644
--- a/doc/new-book/configuration-security.adoc
+++ b/doc/new-book/configuration-security.adoc
@@ -148,18 +148,18 @@ include::{FragmentDir}/fragment-router-sasl-para.adoc[]
 ----
 router {
     ...
-    saslConfigPath: _PATH_
+    saslConfigDir: _PATH_
     saslConfigName: _FILE_NAME_
 }
 ----
 
-`saslConfigPath`:: The absolute path to the SASL configuration file.
+`saslConfigDir`:: The absolute path to the SASL configuration file.
 +
 For example:
 +
 [options="nowrap"]
 ----
-saslConfigPath: /qdrouterd/security
+saslConfigDir: /qdrouterd/security
 ----
 
 `saslConfigName`:: The name of the SASL configuration file. This name should _not_ include the `.conf` file extension.

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/535afa8d/doc/new-book/managing-using-qdmanage.adoc
----------------------------------------------------------------------
diff --git a/doc/new-book/managing-using-qdmanage.adoc b/doc/new-book/managing-using-qdmanage.adoc
index 5a1cd3e..e4616e2 100644
--- a/doc/new-book/managing-using-qdmanage.adoc
+++ b/doc/new-book/managing-using-qdmanage.adoc
@@ -388,7 +388,7 @@ include::managing-using-qdmanage.adoc[tags=qdmanage-connection-options-note]
 a|
 [options="nowrap",subs="+quotes"]
 ----
-qdmanage update --type=router --saslConfigPath=_PATH_ --saslConfigName=_NAME_
+qdmanage update --type=router --saslConfigDir=_PATH_ --saslConfigName=_NAME_
 ----
 
 |Add SASL authentication to an incoming connection
@@ -444,7 +444,7 @@ qdmanage update --name=_LISTENER_NAME_ --requireEncryption=no --saslMechanisms
 a|
 [options="nowrap",subs="+quotes"]
 ----
-qdmanage update --type=router --saslConfigPath --saslConfigName
+qdmanage update --type=router --saslConfigDir --saslConfigName
 ----
 
 |===

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/535afa8d/etc/sasl2/qdrouterd.conf
----------------------------------------------------------------------
diff --git a/etc/sasl2/qdrouterd.conf b/etc/sasl2/qdrouterd.conf
index 430b406..6c8a79d 100644
--- a/etc/sasl2/qdrouterd.conf
+++ b/etc/sasl2/qdrouterd.conf
@@ -46,7 +46,7 @@ mech_list: ANONYMOUS DIGEST-MD5 EXTERNAL PLAIN
 #---------------------------------
 #
 # 1. If you use a nonstandard location for your sasl_config directory,
-#    you can point qdrouterd to it by using the container->saslConfigPath
+#    you can point qdrouterd to it by using the router->saslConfigDir
 #    configuration attribute.
 #
 #    If your nonstandard sasl directory is $MY_SASL_DIR, put a copy

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/535afa8d/python/qpid_dispatch/management/qdrouter.json
----------------------------------------------------------------------
diff --git a/python/qpid_dispatch/management/qdrouter.json b/python/qpid_dispatch/management/qdrouter.json
index 1eaffd7..1d787df 100644
--- a/python/qpid_dispatch/management/qdrouter.json
+++ b/python/qpid_dispatch/management/qdrouter.json
@@ -401,34 +401,39 @@
                     "type": "string",
                     "description": "hostName of machine on which router is running"
                 },
-                "helloInterval": {
+                "helloIntervalSeconds": {
                     "type": "integer",
                     "default": 1,
                     "description": "Interval in seconds between HELLO messages sent to neighbor routers.",
+                    "deprecationName": "helloInterval",
                     "create": true
                 },
-                "helloMaxAge": {
+                "helloMaxAgeSeconds": {
                     "type": "integer",
                     "default": 3,
                     "description": "Time in seconds after which a neighbor is declared lost if no HELLO is received.",
+                    "deprecationName": "helloMaxAge",
                     "create": true
                 },
-                "raInterval": {
+                "raIntervalSeconds": {
                     "type": "integer",
                     "default": 30,
                     "description": "Interval in seconds between Router-Advertisements sent to all routers in a stable network.",
+                    "deprecationName": "raInterval",
                     "create": true
                 },
-                "raIntervalFlux": {
+                "raIntervalFluxSeconds": {
                     "type": "integer",
                     "default": 4,
                     "description": "Interval in seconds between Router-Advertisements sent to all routers during topology fluctuations.",
+                    "deprecationName": "raIntervalFlux",
                     "create": true
                 },
-                "remoteLsMaxAge": {
+                "remoteLsMaxAgeSeconds": {
                     "type": "integer",
                     "default": 60,
                     "description": "Time in seconds after which link state is declared stale if no RA is received.",
+                    "deprecationName": "remoteLsMaxAge",
                     "create": true
                 },
                 "workerThreads": {
@@ -437,14 +442,16 @@
                     "description": "The number of threads that will be created to process message traffic and other application work (timers, non-amqp file descriptors, etc.) .",
                     "create": true
                 },
-                "debugDump": {
+                "debugDumpFile": {
                     "type": "path",
                     "description": "The absolute path to the location for the debug dump file. The router writes debug-level information to this file if the logger is not available.",
+                    "deprecationName": "debugDump",
                     "create": true
                 },
-                "saslConfigPath": {
+                "saslConfigDir": {
                     "type": "path",
                     "description": "Absolute path to the SASL configuration file.",
+                    "deprecationName": "saslConfigPath",
                     "required": false,
                     "create": true
                 },

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/535afa8d/python/qpid_dispatch_internal/router/hello.py
----------------------------------------------------------------------
diff --git a/python/qpid_dispatch_internal/router/hello.py b/python/qpid_dispatch_internal/router/hello.py
index cbd55ed..177e578 100644
--- a/python/qpid_dispatch_internal/router/hello.py
+++ b/python/qpid_dispatch_internal/router/hello.py
@@ -30,8 +30,8 @@ class HelloProtocol(object):
         self.id               = self.container.id
         self.ticks            = 0.0
         self.last_hello_ticks = 0.0
-        self.hello_interval   = container.config.helloInterval
-        self.hello_max_age    = container.config.helloMaxAge
+        self.hello_interval   = container.config.helloIntervalSeconds
+        self.hello_max_age    = container.config.helloMaxAgeSeconds
         self.hellos           = {}
         self.dup_reported     = False
 

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/535afa8d/python/qpid_dispatch_internal/router/link.py
----------------------------------------------------------------------
diff --git a/python/qpid_dispatch_internal/router/link.py b/python/qpid_dispatch_internal/router/link.py
index 13bd1b5..ee051a0 100644
--- a/python/qpid_dispatch_internal/router/link.py
+++ b/python/qpid_dispatch_internal/router/link.py
@@ -28,8 +28,8 @@ class LinkStateEngine(object):
         self.container = container
         self.node_tracker = container.node_tracker
         self.id = self.container.id
-        self.ra_interval_stable = self.container.config.raInterval
-        self.ra_interval_flux   = self.container.config.raIntervalFlux
+        self.ra_interval_stable = self.container.config.raIntervalSeconds
+        self.ra_interval_flux   = self.container.config.raIntervalFluxSeconds
         self.last_ra_time = 0
         self.mobile_seq   = 0
 

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/535afa8d/python/qpid_dispatch_internal/router/node.py
----------------------------------------------------------------------
diff --git a/python/qpid_dispatch_internal/router/node.py b/python/qpid_dispatch_internal/router/node.py
index 31bd3fe..619d88a 100644
--- a/python/qpid_dispatch_internal/router/node.py
+++ b/python/qpid_dispatch_internal/router/node.py
@@ -45,9 +45,9 @@ class NodeTracker(object):
         for i in range(max_routers):
             self.maskbits.append(None)
         self.maskbits[0]      = True
-        self.neighbor_max_age = self.container.config.helloMaxAge
-        self.ls_max_age       = self.container.config.remoteLsMaxAge
-        self.flux_interval    = self.container.config.raIntervalFlux * 2
+        self.neighbor_max_age = self.container.config.helloMaxAgeSeconds
+        self.ls_max_age       = self.container.config.remoteLsMaxAgeSeconds
+        self.flux_interval    = self.container.config.raIntervalFluxSeconds * 2
         self.container.router_adapter.get_agent().add_implementation(self, "router.node")
 
 

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/535afa8d/src/dispatch.c
----------------------------------------------------------------------
diff --git a/src/dispatch.c b/src/dispatch.c
index b9a6b88..622bb79 100644
--- a/src/dispatch.c
+++ b/src/dispatch.c
@@ -187,7 +187,7 @@ qd_error_t qd_dispatch_configure_router(qd_dispatch_t *qd, qd_entity_t *entity)
     qd->allow_resumable_link_route = qd_entity_opt_bool(entity, "allowResumableLinkRoute", true); QD_ERROR_RET();
 
     if (! qd->sasl_config_path) {
-        qd->sasl_config_path = qd_entity_opt_string(entity, "saslConfigPath", 0); QD_ERROR_RET();
+        qd->sasl_config_path = qd_entity_opt_string(entity, "saslConfigDir", 0); QD_ERROR_RET();
     }
     if (! qd->sasl_config_name) {
         qd->sasl_config_name = qd_entity_opt_string(entity, "saslConfigName", "qdrouterd"); QD_ERROR_RET();

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/535afa8d/tests/router_engine_test.py
----------------------------------------------------------------------
diff --git a/tests/router_engine_test.py b/tests/router_engine_test.py
index aef261d..7193443 100644
--- a/tests/router_engine_test.py
+++ b/tests/router_engine_test.py
@@ -151,10 +151,10 @@ class NeighborTest(unittest.TestCase):
         self.instance = 0
         # Fake configuration
         self.config = EntityBase({
-            'helloInterval'    :  1.0,
-            'helloMaxAge'      :  3.0,
-            'raInterval'       : 30.0,
-            'remoteLsMaxAge'   : 60.0 })
+            'helloIntervalSeconds'    :  1.0,
+            'helloMaxAgeSeconds'      :  3.0,
+            'raIntervalSeconds'       : 30.0,
+            'remoteLsMaxAgeSeconds'   : 60.0 })
         self.neighbors = {}
 
     def test_hello_sent(self):

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/535afa8d/tests/system_tests_one_router.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_one_router.py b/tests/system_tests_one_router.py
index 9e42451..8d8cdb0 100644
--- a/tests/system_tests_one_router.py
+++ b/tests/system_tests_one_router.py
@@ -342,17 +342,17 @@ class OneRouterTest(TestCase):
         """
         local_node = Node.connect(self.address, timeout=TIMEOUT)
         outs = local_node.query(type='org.apache.qpid.dispatch.router')
-        debug_dump = outs.attribute_names.index('debugDump')
-        ra_interval_flux = outs.attribute_names.index('raIntervalFlux')
+        debug_dump = outs.attribute_names.index('debugDumpFile')
+        ra_interval_flux = outs.attribute_names.index('raIntervalFluxSeconds')
         worker_threads = outs.attribute_names.index('workerThreads')
         name = outs.attribute_names.index('name')
-        hello_interbval = outs.attribute_names.index('helloInterval')
+        hello_interbval = outs.attribute_names.index('helloIntervalSeconds')
         area = outs.attribute_names.index('area')
-        hello_max_age = outs.attribute_names.index('helloMaxAge')
+        hello_max_age = outs.attribute_names.index('helloMaxAgeSeconds')
         sasl_config_name = outs.attribute_names.index('saslConfigName')
-        remote_ls_max_age = outs.attribute_names.index('remoteLsMaxAge')
+        remote_ls_max_age = outs.attribute_names.index('remoteLsMaxAgeSeconds')
         default_distribution = outs.attribute_names.index('defaultDistribution')
-        ra_interval = outs.attribute_names.index('raInterval')
+        ra_interval = outs.attribute_names.index('raIntervalSeconds')
         mode = outs.attribute_names.index('mode')
 
         self.assertEqual(outs.results[0][debug_dump], 'qddebug.txt')

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/535afa8d/tests/system_tests_sasl_plain.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_sasl_plain.py b/tests/system_tests_sasl_plain.py
index 4e03da8..67070ed 100644
--- a/tests/system_tests_sasl_plain.py
+++ b/tests/system_tests_sasl_plain.py
@@ -87,6 +87,7 @@ class RouterTestPlainSasl(RouterTestPlainSaslCommon):
                                  'id': 'QDR.X',
                                  'mode': 'interior',
                                  'saslConfigName': 'tests-mech-PLAIN',
+                                 # Leave as saslConfigPath for testing backward compatibility
                                  'saslConfigPath': os.getcwd()}),
         ])
 
@@ -233,7 +234,7 @@ class RouterTestPlainSaslOverSsl(RouterTestPlainSaslCommon):
                                  'id': 'QDR.X',
                                  'mode': 'interior',
                                  'saslConfigName': 'tests-mech-PLAIN',
-                                 'saslConfigPath': os.getcwd()}),
+                                 'saslConfigDir': os.getcwd()}),
         ])
 
         super(RouterTestPlainSaslOverSsl, cls).router('Y', [
@@ -363,7 +364,7 @@ class RouterTestVerifyHostNameYes(RouterTestPlainSaslCommon):
                                  'id': 'QDR.X',
                                  'mode': 'interior',
                                  'saslConfigName': 'tests-mech-PLAIN',
-                                 'saslConfigPath': os.getcwd()}),
+                                 'saslConfigDir': os.getcwd()}),
         ])
 
         super(RouterTestVerifyHostNameYes, cls).router('Y', [
@@ -457,7 +458,7 @@ class RouterTestVerifyHostNameNo(RouterTestPlainSaslCommon):
                                  'id': 'QDR.X',
                                  'mode': 'interior',
                                  'saslConfigName': 'tests-mech-PLAIN',
-                                 'saslConfigPath': os.getcwd()}),
+                                 'saslConfigDir': os.getcwd()}),
         ])
 
         super(RouterTestVerifyHostNameNo, cls).router('Y', [

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/535afa8d/tests/system_tests_two_routers.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_two_routers.py b/tests/system_tests_two_routers.py
index 650fcf8..12448dd 100644
--- a/tests/system_tests_two_routers.py
+++ b/tests/system_tests_two_routers.py
@@ -49,7 +49,10 @@ class TwoRouterTest(TestCase):
         def router(name, client_server, connection):
 
             config = [
-                ('router', {'mode': 'interior', 'id': 'QDR.%s'%name, 'allowUnsettledMulticast': 'yes'}),
+                # Use the deprecated attributes helloInterval, raInterval, raIntervalFlux, remoteLsMaxAge
+                # The routers should still start successfully after using these deprecated entities.
+                ('router', {'remoteLsMaxAge': 60, 'helloInterval': 1, 'raInterval': 30, 'raIntervalFlux': 4,
+                            'mode': 'interior', 'id': 'QDR.%s'%name, 'allowUnsettledMulticast': 'yes'}),
 
                 ('listener', {'port': cls.tester.get_port(), 'stripAnnotations': 'no', 'linkCapacity': 500}),
 


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