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 ae4522af3bf1c43f95ac3a1f91bbf543f15d0a6c Author: Susan Hinrichs <[email protected]> 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 905d268..793a7a5 100644 --- a/iocore/net/UnixNetProcessor.cc +++ b/iocore/net/UnixNetProcessor.cc @@ -219,7 +219,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 fc3f7a6..49335fd 100644 --- a/iocore/net/UnixNetVConnection.cc +++ b/iocore/net/UnixNetVConnection.cc @@ -1344,6 +1344,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 (ep.start(get_PollDescriptor(t), this, EVENTIO_READ | EVENTIO_WRITE) < 0) {
