Repository: qpid-dispatch
Updated Branches:
  refs/heads/master d21597716 -> f0e15f82f


DISPATCH-1112 - Detach takes a higher priority when processing link work.  This 
closes #369


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

Branch: refs/heads/master
Commit: f0e15f82f577ac5bb86e377a7711da2a3ff73767
Parents: d215977
Author: Fernando Giorgetti <fgior...@redhat.com>
Authored: Thu Aug 30 23:40:47 2018 -0300
Committer: Ganesh Murthy <gmur...@redhat.com>
Committed: Fri Aug 31 16:05:29 2018 -0400

----------------------------------------------------------------------
 src/router_core/connections.c         | 5 ++++-
 src/router_core/router_core_private.h | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/f0e15f82/src/router_core/connections.c
----------------------------------------------------------------------
diff --git a/src/router_core/connections.c b/src/router_core/connections.c
index 30166b1..786877e 100644
--- a/src/router_core/connections.c
+++ b/src/router_core/connections.c
@@ -311,7 +311,7 @@ int qdr_connection_process(qdr_connection_t *conn)
                 }
 
                 sys_mutex_lock(conn->work_lock);
-                if (link_work->work_type == QDR_LINK_WORK_DELIVERY && 
link_work->value > 0) {
+                if (link_work->work_type == QDR_LINK_WORK_DELIVERY && 
link_work->value > 0 && !link->detach_received) {
                     DEQ_INSERT_HEAD(link->work_list, link_work);
                     link_work->processing = false;
                     link_work = 0; // Halt work processing
@@ -915,6 +915,9 @@ void qdr_link_outbound_detach_CT(qdr_core_t *core, 
qdr_link_t *link, qdr_error_t
     qdr_link_work_t *work = new_qdr_link_work_t();
     ZERO(work);
     work->work_type  = ++link->detach_count == 1 ? QDR_LINK_WORK_FIRST_DETACH 
: QDR_LINK_WORK_SECOND_DETACH;
+    if (work->work_type == QDR_LINK_WORK_SECOND_DETACH) {
+        link->detach_received = true;
+    }
     work->close_link = close;
 
     if (error)

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/f0e15f82/src/router_core/router_core_private.h
----------------------------------------------------------------------
diff --git a/src/router_core/router_core_private.h 
b/src/router_core/router_core_private.h
index c895c99..a68e115 100644
--- a/src/router_core/router_core_private.h
+++ b/src/router_core/router_core_private.h
@@ -406,6 +406,7 @@ struct qdr_link_t {
     bool                     strip_annotations_out;
     bool                     drain_mode;
     bool                     stalled_outbound;  ///< Indicates that this link 
is stalled on outbound buffer backpressure
+    bool                     detach_received;
     char                    *strip_prefix;
     char                    *insert_prefix;
     bool                     terminus_survives_disconnect;


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

Reply via email to