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

zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 7b864c7ff33a9292d6e8ff041fde30bcfd03219c
Author: Susan Hinrichs <[email protected]>
AuthorDate: Thu May 31 13:37:01 2018 -0500

    Only increment currently_open if socket connects (take 2)
    
    (cherry picked from commit 8ab542344ebc54d3ad42831887ca620be3b43dee)
    
    Conflicts:
        iocore/net/UnixNetVConnection.cc
---
 iocore/net/UnixNetVConnection.cc | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/iocore/net/UnixNetVConnection.cc b/iocore/net/UnixNetVConnection.cc
index 49335fd..aa1737c 100644
--- a/iocore/net/UnixNetVConnection.cc
+++ b/iocore/net/UnixNetVConnection.cc
@@ -1344,10 +1344,6 @@ UnixNetVConnection::connectUp(EThread *t, int fd)
     con.is_bound     = true;
   }
 
-  // Did not fail, increment connection count
-  NET_SUM_GLOBAL_DYN_STAT(net_connections_currently_open_stat, 1);
-  ink_release_assert(con.fd != NO_FD);
-
   // Must connect after EventIO::Start() to avoid a race condition
   // when edge triggering is used.
   if (ep.start(get_PollDescriptor(t), this, EVENTIO_READ | EVENTIO_WRITE) < 0) 
{
@@ -1363,8 +1359,11 @@ UnixNetVConnection::connectUp(EThread *t, int fd)
     }
   }
 
-  // start up next round immediately
+  // Did not fail, increment connection count
+  NET_SUM_GLOBAL_DYN_STAT(net_connections_currently_open_stat, 1);
+  ink_release_assert(con.fd != NO_FD);
 
+  // start up next round immediately
   SET_HANDLER(&UnixNetVConnection::mainEvent);
 
   nh = get_NetHandler(t);

Reply via email to