You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2016/12/20 21:12:00 UTC

qpid-dispatch git commit: DISPATCH-577: Fix latency regression introduced by commit 6e6929c

Repository: qpid-dispatch
Updated Branches:
  refs/heads/master fcdaf22a8 -> b325f6bea


DISPATCH-577: Fix latency regression introduced by commit 6e6929c

That commit introduced sporadic high latency messages, caused by insufficient
polling. This fixes the problem and is still fairly conservative: it checks the
need to re-poll before read/write processing rather than after, which could
result in at most one extra poll when the transport becomes
un-readable/un-writable.


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

Branch: refs/heads/master
Commit: b325f6bea366d029bf6366a0aa8ad69f82ce2b17
Parents: fcdaf22
Author: Alan Conway <ac...@redhat.com>
Authored: Tue Dec 20 16:01:53 2016 -0500
Committer: Alan Conway <ac...@redhat.com>
Committed: Tue Dec 20 16:07:00 2016 -0500

----------------------------------------------------------------------
 src/posix/driver.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/b325f6be/src/posix/driver.c
----------------------------------------------------------------------
diff --git a/src/posix/driver.c b/src/posix/driver.c
index 1d18bbe..cfef416 100644
--- a/src/posix/driver.c
+++ b/src/posix/driver.c
@@ -735,11 +735,14 @@ static void connector_process(qdpn_connector_t *c)
     if(c->closed) return;
 
     pn_transport_t *transport = c->transport;
+    c->status = 0;
+
     ///
     /// Socket read
     ///
     ssize_t capacity = pn_transport_capacity(transport);
     if (capacity > 0) {
+        c->status |= PN_SEL_RD;
         if (c->pending_read) {
             c->pending_read = false;
             ssize_t n =  recv(c->fd, pn_transport_tail(transport), capacity, 0);
@@ -766,6 +769,7 @@ static void connector_process(qdpn_connector_t *c)
     ///
     ssize_t pending = pn_transport_pending(transport);
     if (pending > 0) {
+        c->status |= PN_SEL_WR;
         if (c->pending_write) {
             c->pending_write = false;
 #ifdef MSG_NOSIGNAL
@@ -784,12 +788,8 @@ static void connector_process(qdpn_connector_t *c)
         }
     }
 
-    c->status = 0;
     if (pn_transport_closed(c->transport)) {
         qdpn_connector_close(c);
-    } else {
-        if (pn_transport_capacity(transport) > 0) c->status |= PN_SEL_RD;
-        if (pn_transport_pending(transport) > 0) c->status |= PN_SEL_WR;
     }
 }
 


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