cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [1/10] git commit: Unbounded (?) thread growth connecting to an removed node Patch by Vijay, reviewed by Brandon Williams for CASSANDRA-5175
Date Thu, 24 Jan 2013 14:58:02 GMT
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.2
Commit: fc1daa3a7fb7328c70b3f07e3234f129ddfa56af
Parents: 3b36864
Author: Vijay Parthasarathy <vijay2win@gmail.com>
Authored: Tue Jan 22 22:41:00 2013 -0800
Committer: Vijay Parthasarathy <vijay2win@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)


Mime
View raw message