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:43:00 UTC

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

Updated Branches:
  refs/heads/cassandra-1.1 3b3686460 -> fc1daa3a7


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/fc1daa3a
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/fc1daa3a
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/fc1daa3a

Branch: refs/heads/cassandra-1.1
Commit: fc1daa3a7fb7328c70b3f07e3234f129ddfa56af
Parents: 3b36864
Author: Vijay Parthasarathy <vi...@gmail.com>
Authored: Tue Jan 22 22:41:00 2013 -0800
Committer: Vijay Parthasarathy <vi...@gmail.com>
Committed: Tue Jan 22 22:41:00 2013 -0800

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


http://git-wip-us.apache.org/repos/asf/cassandra/blob/fc1daa3a/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 e826fe3..794ed29 100644
--- a/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
+++ b/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
@@ -45,6 +45,7 @@ public class OutboundTcpConnection extends Thread
                                                               StorageService.Verb.INTERNAL_RESPONSE,
                                                               ArrayUtils.EMPTY_BYTE_ARRAY,
                                                               MessagingService.version_);
+    private volatile boolean isStopped = false;
 
     private static final int OPEN_RETRY_DELAY = 100; // ms between retries
 
@@ -83,6 +84,7 @@ public class OutboundTcpConnection extends Thread
     {
         active.clear();
         backlog.clear();
+        isStopped = true; // Exit loop to stop the thread
         enqueue(CLOSE_SENTINEL, null);
     }
 
@@ -93,7 +95,7 @@ public class OutboundTcpConnection extends Thread
 
     public void run()
     {
-        while (true)
+        while (!isStopped)
         {
             Entry entry = active.poll();
             if (entry == null)