You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by vi...@apache.org on 2013/01/23 07:46:03 UTC

[1/2] git commit: Unbounded (?) thread growth connecting to an removed node Patch by Vijay, reviewed by Brandon Williams for CASSANDRA-5175

Unbounded (?) thread growth connecting to an removed node
Patch by Vijay, reviewed by Brandon Williams for CASSANDRA-5175


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

Branch: refs/heads/trunk
Commit: 09634692718a92fbc435c30012c22a709667c343
Parents: 1559b49
Author: Vijay Parthasarathy <vi...@gmail.com>
Authored: Tue Jan 22 22:44:35 2013 -0800
Committer: Vijay Parthasarathy <vi...@gmail.com>
Committed: Tue Jan 22 22:44:35 2013 -0800

----------------------------------------------------------------------
 .../cassandra/net/OutboundTcpConnection.java       |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/09634692/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/net/OutboundTcpConnection.java b/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
index 42183f4..1572417 100644
--- a/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
+++ b/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
@@ -46,6 +46,7 @@ public class OutboundTcpConnection extends Thread
     private static final Logger logger = LoggerFactory.getLogger(OutboundTcpConnection.class);
 
     private static final MessageOut CLOSE_SENTINEL = new MessageOut(MessagingService.Verb.INTERNAL_RESPONSE);
+    private volatile boolean isStopped = false;
 
     private static final int OPEN_RETRY_DELAY = 100; // ms between retries
 
@@ -92,6 +93,7 @@ public class OutboundTcpConnection extends Thread
     {
         active.clear();
         backlog.clear();
+        isStopped = true; // Exit loop to stop the thread
         enqueue(CLOSE_SENTINEL, null);
     }
 
@@ -107,7 +109,7 @@ public class OutboundTcpConnection extends Thread
 
     public void run()
     {
-        while (true)
+        while (!isStopped)
         {
             QueuedMessage qm = active.poll();
             if (qm == null)