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 2021/03/26 19:24:49 UTC

[qpid-dispatch] branch master updated: DISPATCH-2015: TSAN fixes for the http1 adaptor. This closes #1084.

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

gmurthy 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 66043e3  DISPATCH-2015: TSAN fixes for the http1 adaptor. This closes #1084.
66043e3 is described below

commit 66043e3eb5df17df2ed9bf650635f67578ec30bd
Author: Ganesh Murthy <gm...@apache.org>
AuthorDate: Tue Mar 23 16:26:45 2021 -0400

    DISPATCH-2015: TSAN fixes for the http1 adaptor. This closes #1084.
---
 src/adaptors/http1/http1_server.c | 7 ++++++-
 src/router_core/forwarder.c       | 2 ++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/adaptors/http1/http1_server.c b/src/adaptors/http1/http1_server.c
index 76c35cb..d22127a 100644
--- a/src/adaptors/http1/http1_server.c
+++ b/src/adaptors/http1/http1_server.c
@@ -409,7 +409,12 @@ static void _do_reconnect(void *context)
     // while timers do not run concurrently it is possible to reschedule them
     // via another thread while the timer handler is running, resulting in this
     // handler running twice
-    if (hconn->raw_conn) return;  // already ran
+    sys_mutex_lock(qdr_http1_adaptor->lock);
+    if (hconn->raw_conn)  {
+        sys_mutex_unlock(qdr_http1_adaptor->lock);
+        return;  // already ran
+    }
+    sys_mutex_unlock(qdr_http1_adaptor->lock);
 
     if (hconn->qdr_conn) {
 
diff --git a/src/router_core/forwarder.c b/src/router_core/forwarder.c
index 106a3f0..166916c 100644
--- a/src/router_core/forwarder.c
+++ b/src/router_core/forwarder.c
@@ -795,7 +795,9 @@ int qdr_forward_balanced_CT(qdr_core_t      *core,
     qdr_link_ref_t *link_ref = DEQ_HEAD(addr->rlinks);
     while (link_ref && eligible_link_value != 0) {
         qdr_link_t *link     = link_ref->link;
+        sys_mutex_lock(link->conn->work_lock);
         uint32_t    value    = DEQ_SIZE(link->undelivered) + DEQ_SIZE(link->unsettled);
+        sys_mutex_unlock(link->conn->work_lock);
         bool        eligible = link->capacity > value;
 
         //

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