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 2013/04/15 22:46:10 UTC

[03/50] git commit: TS-1796 remove cluster connection number change handle

TS-1796  remove cluster connection number change handle


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/5c04d4aa
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/5c04d4aa
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/5c04d4aa

Branch: refs/heads/3.3.x
Commit: 5c04d4aac4cd34be94d0dab4d376a30937653c08
Parents: 9e57b8a
Author: Chen Bin <ku...@taobao.com>
Authored: Tue Apr 2 11:22:04 2013 +0800
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Mon Apr 15 14:45:42 2013 -0600

----------------------------------------------------------------------
 iocore/cluster/ClusterHandlerBase.cc |   21 +++------------------
 1 files changed, 3 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5c04d4aa/iocore/cluster/ClusterHandlerBase.cc
----------------------------------------------------------------------
diff --git a/iocore/cluster/ClusterHandlerBase.cc b/iocore/cluster/ClusterHandlerBase.cc
index a8ee01c..ee8070c 100644
--- a/iocore/cluster/ClusterHandlerBase.cc
+++ b/iocore/cluster/ClusterHandlerBase.cc
@@ -1038,28 +1038,13 @@ ClusterHandler::startClusterEvent(int event, Event * e)
             CLUSTER_INCREMENT_DYN_STAT(CLUSTER_NODES_STAT);
             this_cluster()->configurations.push(cconf);
           } else {
-            if (m->num_connections > machine->num_connections) {
-              // close old needlessness connection if new num_connections < old num_connections
-              for (int i = machine->num_connections; i < m->num_connections; i++) {
-                if (m->clusterHandlers[i])
-                  m->clusterHandlers[i]->downing = true;
-              }
-              m->free_connections -= (m->num_connections - machine->num_connections);
-              m->num_connections = machine->num_connections;
-              // delete_this
+            // close new connection if old connections is exist
+            if (id >= m->num_connections || m->clusterHandlers[id]) {
               failed = -2;
               MUTEX_UNTAKE_LOCK(the_cluster_config_mutex, this_ethread());
               goto failed;
-            } else {
-              m->num_connections = machine->num_connections;
-              // close new connection if old connections is exist
-              if (id >= m->num_connections || m->clusterHandlers[id]) {
-                failed = -2;
-                MUTEX_UNTAKE_LOCK(the_cluster_config_mutex, this_ethread());
-                goto failed;
-              }
-              machine = m;
             }
+            machine = m;
           }
           machine->now_connections++;
           machine->clusterHandlers[id] = this;