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

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


The following commit(s) were added to refs/heads/master by this push:
     new 9722a7f  PROTON-2304: fix epoll proactor hang removing and replacing 
same canceled timer at front of timers list repeatedly
9722a7f is described below

commit 9722a7f9d3afadffe1883305aff64bfaf977f596
Author: Cliff Jansen <cliffjan...@apache.org>
AuthorDate: Mon Nov 16 22:06:07 2020 -0800

    PROTON-2304: fix epoll proactor hang removing and replacing same canceled 
timer at front of timers list repeatedly
---
 c/src/proactor/epoll_timer.c | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/c/src/proactor/epoll_timer.c b/c/src/proactor/epoll_timer.c
index 6c7c3db..6d288e1 100644
--- a/c/src/proactor/epoll_timer.c
+++ b/c/src/proactor/epoll_timer.c
@@ -326,17 +326,19 @@ pn_event_batch_t 
*pni_timer_manager_process(pni_timer_manager_t *tm, bool timeou
       lock(&tm->context.mutex);
     } else {
       uint64_t deadline = td->timer->deadline;
-      if (deadline && deadline <= now) {
-        td->timer->deadline = 0;
-        pconnection_t *pc = td->timer->connection;
-        lock(&tm->deletion_mutex);     // Prevent connection from deleting 
itself when tm->context.mutex dropped.
-        unlock(&tm->context.mutex);
-        pni_pconnection_timeout(pc);
-        unlock(&tm->deletion_mutex);
-        lock(&tm->context.mutex);
-      } else {
-        td->list_deadline = td->timer->deadline;
-        pn_list_minpush(tm->timers_heap, td);
+      if (deadline) {
+        if (deadline <= now) {
+          td->timer->deadline = 0;
+          pconnection_t *pc = td->timer->connection;
+          lock(&tm->deletion_mutex);     // Prevent connection from deleting 
itself when tm->context.mutex dropped.
+          unlock(&tm->context.mutex);
+          pni_pconnection_timeout(pc);
+          unlock(&tm->deletion_mutex);
+          lock(&tm->context.mutex);
+        } else {
+          td->list_deadline = deadline;
+          pn_list_minpush(tm->timers_heap, td);
+        }
       }
     }
   }


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

Reply via email to