Created
November 2, 2012 15:38
-
-
Save yukim/4002080 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
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(); | |
+ } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment