cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [4/10] git commit: Fix test failures for CASSANDRA-5175
Date Thu, 24 Jan 2013 14:58:02 GMT
Fix test failures 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/11d14146
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/11d14146
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/11d14146

Branch: refs/heads/trunk
Commit: 11d1414628c18d07f7449af0aa9374406077b9a8
Parents: fc1daa3
Author: Vijay Parthasarathy <vijay2win@gmail.com>
Authored: Tue Jan 22 23:38:14 2013 -0800
Committer: Vijay Parthasarathy <vijay2win@gmail.com>
Committed: Tue Jan 22 23:38:14 2013 -0800

----------------------------------------------------------------------
 .../org/apache/cassandra/net/MessagingService.java |    4 ++--
 .../cassandra/net/OutboundTcpConnection.java       |    8 +++++---
 .../cassandra/net/OutboundTcpConnectionPool.java   |    2 +-
 3 files changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/11d14146/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 7974e6c..b605575 100644
--- a/src/java/org/apache/cassandra/net/MessagingService.java
+++ b/src/java/org/apache/cassandra/net/MessagingService.java
@@ -305,9 +305,9 @@ public final class MessagingService implements MessagingServiceMBean
             return;
         // these null guards are simply for tests
         if (cp.ackCon != null)
-            cp.ackCon.closeSocket();
+            cp.ackCon.closeSocket(true);
         if (cp.cmdCon != null)
-            cp.cmdCon.closeSocket();
+            cp.cmdCon.closeSocket(true);
         connectionManagers_.remove(to);
         recentTimeoutsPerHost.remove(to.getHostAddress());
         timeoutsPerHost.remove(to.getHostAddress());

http://git-wip-us.apache.org/repos/asf/cassandra/blob/11d14146/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 794ed29..73d0c15 100644
--- a/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
+++ b/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
@@ -80,11 +80,11 @@ public class OutboundTcpConnection extends Thread
         }
     }
 
-    void closeSocket()
+    void closeSocket(boolean destroyThread)
     {
         active.clear();
         backlog.clear();
-        isStopped = true; // Exit loop to stop the thread
+        isStopped = destroyThread; // Exit loop to stop the thread
         enqueue(CLOSE_SENTINEL, null);
     }
 
@@ -95,7 +95,7 @@ public class OutboundTcpConnection extends Thread
 
     public void run()
     {
-        while (!isStopped)
+        while (true)
         {
             Entry entry = active.poll();
             if (entry == null)
@@ -120,6 +120,8 @@ public class OutboundTcpConnection extends Thread
             if (m == CLOSE_SENTINEL)
             {
                 disconnect();
+                if (isStopped)
+                    break;
                 continue;
             }
             if (entry.timestamp < System.currentTimeMillis() - DatabaseDescriptor.getRpcTimeout())

http://git-wip-us.apache.org/repos/asf/cassandra/blob/11d14146/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 4e5a479..eca0733 100644
--- a/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java
+++ b/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java
@@ -63,7 +63,7 @@ public class OutboundTcpConnectionPool
     synchronized void reset()
     {
         for (OutboundTcpConnection con : new OutboundTcpConnection[] { cmdCon, ackCon })
-            con.closeSocket();
+            con.closeSocket(false);
     }
 
     /**


Mime
View raw message