qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kgiu...@apache.org
Subject qpid-proton git commit: PROTON-1090: fix reactor timer pipe cleanup to prevent 100% cpu spin
Date Fri, 08 Jan 2016 15:01:53 GMT
Repository: qpid-proton
Updated Branches:
  refs/heads/master 7486d5b85 -> 25d39a8e9


PROTON-1090: fix reactor timer pipe cleanup to prevent 100% cpu spin


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

Branch: refs/heads/master
Commit: 25d39a8e9cbf4846f23e4e58175d902924ec1a30
Parents: 7486d5b
Author: Gordon Sim <gsim@redhat.com>
Authored: Fri Jan 8 10:01:37 2016 -0500
Committer: Ken Giusti <kgiusti@apache.org>
Committed: Fri Jan 8 10:01:37 2016 -0500

----------------------------------------------------------------------
 proton-c/src/reactor/reactor.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/25d39a8e/proton-c/src/reactor/reactor.c
----------------------------------------------------------------------
diff --git a/proton-c/src/reactor/reactor.c b/proton-c/src/reactor/reactor.c
index 6b328bc..7ea279b 100644
--- a/proton-c/src/reactor/reactor.c
+++ b/proton-c/src/reactor/reactor.c
@@ -443,7 +443,15 @@ static void pni_timer_readable(pn_selectable_t *sel) {
 
 static void pni_timer_finalize(pn_selectable_t *sel) {
   pn_reactor_t *reactor = pni_reactor(sel);
-  pn_close(reactor->io, pn_selectable_get_fd(sel));
+  pn_socket_t fd = pn_selectable_get_fd(sel);
+  if (fd == reactor->wakeup[0]) {
+    for (int i = 0; i < 2; i++) {
+      if (reactor->wakeup[i] != PN_INVALID_SOCKET) {
+        pn_close(reactor->io, reactor->wakeup[i]);
+        reactor->wakeup[i] = PN_INVALID_SOCKET;
+      }
+    }
+  }
 }
 
 pn_selectable_t *pni_timer_selectable(pn_reactor_t *reactor) {


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


Mime
View raw message