This is an automated email from the ASF dual-hosted git repository.
shinrich pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new 6f11192 TS-4187: Keep the currently_open connections in sync with
the number of sockets open. This closes #583.
6f11192 is described below
commit 6f1119222126db29e508104f88782b2478972bdf
Author: Susan Hinrichs <[email protected]>
AuthorDate: Fri Apr 15 16:34:25 2016 +0000
TS-4187: Keep the currently_open connections in sync with the number of
sockets open. This closes #583.
---
iocore/net/SSLNetVConnection.cc | 1 -
iocore/net/UnixNetVConnection.cc | 8 +++-----
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/iocore/net/SSLNetVConnection.cc b/iocore/net/SSLNetVConnection.cc
index df241a2..7f299c2 100644
--- a/iocore/net/SSLNetVConnection.cc
+++ b/iocore/net/SSLNetVConnection.cc
@@ -870,7 +870,6 @@ SSLNetVConnection::do_io_close(int lerrno)
void
SSLNetVConnection::free(EThread *t)
{
- NET_SUM_GLOBAL_DYN_STAT(net_connections_currently_open_stat, -1);
got_remote_addr = 0;
got_local_addr = 0;
read.vio.mutex.clear();
diff --git a/iocore/net/UnixNetVConnection.cc b/iocore/net/UnixNetVConnection.cc
index 8d12823..633d9fe 100644
--- a/iocore/net/UnixNetVConnection.cc
+++ b/iocore/net/UnixNetVConnection.cc
@@ -97,6 +97,9 @@ net_activity(UnixNetVConnection *vc, EThread *thread)
void
close_UnixNetVConnection(UnixNetVConnection *vc, EThread *t)
{
+ if (vc->con.fd != NO_FD) {
+ NET_SUM_GLOBAL_DYN_STAT(net_connections_currently_open_stat, -1);
+ }
NetHandler *nh = vc->nh;
vc->cancel_OOB();
vc->ep.stop();
@@ -1312,7 +1315,6 @@ void
UnixNetVConnection::free(EThread *t)
{
ink_release_assert(t == this_ethread());
- NET_SUM_GLOBAL_DYN_STAT(net_connections_currently_open_stat, -1);
// clear variables for reuse
this->mutex.clear();
action_.mutex.clear();
@@ -1387,10 +1389,6 @@ UnixNetVConnection::migrateToCurrentThread(Continuation
*cont, EThread *t)
this->ep.stop();
this->do_io_close();
- // The do_io_close will decrement the current stat count but we are creating
a new vc.
- // Increment the currently open stat here so the net current count is
unchanged
- NET_SUM_GLOBAL_DYN_STAT(net_connections_currently_open_stat, 1);
-
// Create new VC:
if (save_ssl) {
SSLNetVConnection *sslvc = static_cast<SSLNetVConnection
*>(sslNetProcessor.allocate_vc(t));
--
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].