cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yu...@apache.org
Subject git commit: release metrix after destroy connection
Date Fri, 02 Nov 2012 15:44:30 GMT
Updated Branches:
  refs/heads/trunk 38a377336 -> 3d3d93cef


release metrix after destroy connection


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/3d3d93ce
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/3d3d93ce
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/3d3d93ce

Branch: refs/heads/trunk
Commit: 3d3d93cef4e1d078eedefc67c5890296bd19567a
Parents: 38a3773
Author: Yuki Morishita <yukim@apache.org>
Authored: Fri Nov 2 10:44:19 2012 -0500
Committer: Yuki Morishita <yukim@apache.org>
Committed: Fri Nov 2 10:44:19 2012 -0500

----------------------------------------------------------------------
 .../org/apache/cassandra/net/MessagingService.java |    6 +-----
 .../cassandra/net/OutboundTcpConnectionPool.java   |   10 ++++++++++
 2 files changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/3d3d93ce/src/java/org/apache/cassandra/net/MessagingService.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/net/MessagingService.java b/src/java/org/apache/cassandra/net/MessagingService.java
index cb58314..553301d 100644
--- a/src/java/org/apache/cassandra/net/MessagingService.java
+++ b/src/java/org/apache/cassandra/net/MessagingService.java
@@ -469,11 +469,7 @@ public final class MessagingService implements MessagingServiceMBean
         OutboundTcpConnectionPool cp = connectionManagers.get(to);
         if (cp == null)
             return;
-        // these null guards are simply for tests
-        if (cp.ackCon != null)
-            cp.ackCon.closeSocket();
-        if (cp.cmdCon != null)
-            cp.cmdCon.closeSocket();
+        cp.close();
         connectionManagers.remove(to);
     }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3d3d93ce/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java b/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java
index c9cb8d0..4d9ce63 100644
--- a/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java
+++ b/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java
@@ -156,4 +156,14 @@ public class OutboundTcpConnectionPool
         }
         return true;
     }
+
+   public void close()
+    {
+        // these null guards are simply for tests
+        if (ackCon != null)
+            ackCon.closeSocket();
+        if (cmdCon != null)
+            cmdCon.closeSocket();
+        metrics.release();
+    }
 }


Mime
View raw message