You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kg...@apache.org on 2020/09/30 18:54:02 UTC

[qpid-dispatch] branch dev-protocol-adaptors updated: Move deletion of AMQP adaptor to core thread

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

kgiusti pushed a commit to branch dev-protocol-adaptors
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git


The following commit(s) were added to refs/heads/dev-protocol-adaptors by this push:
     new 2810767  Move deletion of AMQP adaptor to core thread
2810767 is described below

commit 2810767b7c3f66f0db1aec00a8ab8d9386f15df6
Author: Kenneth Giusti <kg...@apache.org>
AuthorDate: Tue Sep 29 12:02:42 2020 -0400

    Move deletion of AMQP adaptor to core thread
    
    This fixes a race where the core thread is accessing the adaptor while
    it is being shut down.
    
    This closes #854
---
 src/router_core/router_core_thread.c | 3 +++
 src/router_node.c                    | 1 -
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/router_core/router_core_thread.c b/src/router_core/router_core_thread.c
index f55d67e..c6a6c54 100644
--- a/src/router_core/router_core_thread.c
+++ b/src/router_core/router_core_thread.c
@@ -168,6 +168,9 @@ void qdr_adaptors_finalize(qdr_core_t *core)
         adaptor = DEQ_PREV(adaptor);
     }
 
+    // release the default AMQP adaptor (it is not a module)
+    assert(DEQ_SIZE(core->protocol_adaptors) == 1);
+    qdr_protocol_adaptor_free(core, DEQ_HEAD(core->protocol_adaptors));
 }
 
 
diff --git a/src/router_node.c b/src/router_node.c
index aa69f29..315a251 100644
--- a/src/router_node.c
+++ b/src/router_node.c
@@ -2001,7 +2001,6 @@ void qd_router_free(qd_router_t *router)
 
     qd_container_set_default_node_type(router->qd, 0, 0, QD_DIST_BOTH);
 
-    qdr_protocol_adaptor_free(router->router_core, amqp_direct_adaptor);
     qdr_core_free(router->router_core);
     qd_tracemask_free(router->tracemask);
     qd_timer_free(router->timer);


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