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

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


The following commit(s) were added to refs/heads/master by this push:
     new 913df20  DISPATCH-1764: At boot time configure connectors and then 
listeners last
913df20 is described below

commit 913df20c1860e4c59e359aaffdc0afbf798a0246
Author: Chuck Rolke <c...@apache.org>
AuthorDate: Tue Sep 8 20:04:16 2020 -0400

    DISPATCH-1764: At boot time configure connectors and then listeners last
    
    Give the router a stable initial configuration before opening any
    external I/O.
---
 python/qpid_dispatch_internal/management/config.py | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/python/qpid_dispatch_internal/management/config.py 
b/python/qpid_dispatch_internal/management/config.py
index eabf7f7..8eaeb0a 100644
--- a/python/qpid_dispatch_internal/management/config.py
+++ b/python/qpid_dispatch_internal/management/config.py
@@ -278,7 +278,7 @@ def configure_dispatch(dispatch, lib_handle, filename):
     dispatch = qd.qd_dispatch_p(dispatch)
     config = Config(filename)
 
-    # NOTE: Can't import agent till dispatch C extension module is initialized.
+    # NOTE: Can't import agent until dispatch C extension module is 
initialized.
     from .agent import Agent
     agent = Agent(dispatch, qd)
     qd.qd_dispatch_set_agent(dispatch, agent)
@@ -318,8 +318,8 @@ def configure_dispatch(dispatch, lib_handle, filename):
     agent.policy.set_use_hostname_patterns(useHostnamePatterns)
     agent.policy.set_max_message_size(maxMessageSize)
 
-    # Configure types that may be duplicated many times; don't configure 
listeners
-    for t in "sslProfile", "authServicePlugin", "connector", \
+    # Configure a block of types
+    for t in "sslProfile", "authServicePlugin", \
              "router.config.address", "router.config.linkRoute", 
"router.config.autoLink", \
              "router.config.exchange", "router.config.binding", \
              "vhost":
@@ -331,9 +331,9 @@ def configure_dispatch(dispatch, lib_handle, filename):
                     ssl_profile_name = a.get('name')
                     displayname_service.add(ssl_profile_name, 
display_file_name)
 
-    # Configure remaining singleton types; don't configure listeners
+    # Configure remaining types except for connector and listener
     for e in config.entities:
-        if not e['type'] == 'org.apache.qpid.dispatch.listener':
+        if not e['type'] in ['org.apache.qpid.dispatch.connector', 
'org.apache.qpid.dispatch.listener']:
             configure(e)
 
     # Load the vhosts from the .json files in policyDir
@@ -346,6 +346,9 @@ def configure_dispatch(dispatch, lib_handle, filename):
                 for a in pconfig.by_type("vhost"):
                     agent.configure(a)
 
-    # Configure listeners
-    for a in config.by_type("listener"):
-        configure(a)
+    # Static configuration is loaded except for connectors and listeners.
+    # Configuring connectors and listeners last starts inter-router and user 
messages
+    # when the router is in a known and repeatable initial configuration state.
+    for t in "connector", "listener":
+        for a in config.by_type(t):
+            configure(a)


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

Reply via email to