You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2018/06/06 07:37:10 UTC

[trafficserver] 03/11: Only increment currently_open count if FD is really open

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

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

commit e759a173c583d938b732ff3735f17e8787041cda
Author: Susan Hinrichs <sh...@apache.org>
AuthorDate: Wed May 30 08:44:52 2018 -0500

    Only increment currently_open count if FD is really open
    
    (cherry picked from commit f6895ff56a3dbd4571bd06a3cac6608319ec474b)
---
 iocore/net/UnixNetProcessor.cc   | 1 -
 iocore/net/UnixNetVConnection.cc | 4 ++++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/iocore/net/UnixNetProcessor.cc b/iocore/net/UnixNetProcessor.cc
index 33f6824..3b11c20 100644
--- a/iocore/net/UnixNetProcessor.cc
+++ b/iocore/net/UnixNetProcessor.cc
@@ -234,7 +234,6 @@ UnixNetProcessor::connect_re_internal(Continuation *cont, sockaddr const *target
   );
   SocksEntry *socksEntry = nullptr;
 
-  NET_SUM_GLOBAL_DYN_STAT(net_connections_currently_open_stat, 1);
   vc->id          = net_next_connection_number();
   vc->submit_time = Thread::get_hrtime();
   vc->mutex       = cont->mutex;
diff --git a/iocore/net/UnixNetVConnection.cc b/iocore/net/UnixNetVConnection.cc
index 3b9244e..a071ebcc 100644
--- a/iocore/net/UnixNetVConnection.cc
+++ b/iocore/net/UnixNetVConnection.cc
@@ -1277,6 +1277,10 @@ 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 ((res = get_NetHandler(t)->startIO(this)) < 0) {

-- 
To stop receiving notification emails like this one, please contact
zwoop@apache.org.