cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jasobr...@apache.org
Subject git commit: Non-droppable verbs shouldn't be dropped from OTC
Date Tue, 08 Apr 2014 23:10:30 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-1.2 97a6e36bc -> d41c07572


Non-droppable verbs shouldn't be dropped from OTC

patch by jasobrown; reviewed by Richard Low for CASSANDRA-6980


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

Branch: refs/heads/cassandra-1.2
Commit: d41c075721428b4beece0d8b22086a8017664280
Parents: 97a6e36
Author: Jason Brown <jasobrown@apple.com>
Authored: Tue Apr 8 16:08:19 2014 -0700
Committer: Jason Brown <jasobrown@apple.com>
Committed: Tue Apr 8 16:08:19 2014 -0700

----------------------------------------------------------------------
 CHANGES.txt                                             |  1 +
 .../org/apache/cassandra/net/OutboundTcpConnection.java | 12 ++++++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/d41c0757/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index dc8e6e0..b3e5310 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -3,6 +3,7 @@
    (CASSANDRA-6822)
  * Continue assassinating even if the endpoint vanishes (CASSANDRA-6787)
  * Schedule schema pulls on change (CASSANDRA-6971)
+ * Non-droppable verbs shouldn't be dropped from OTC (CASSANDRA-6980)
 
 
 1.2.16

http://git-wip-us.apache.org/repos/asf/cassandra/blob/d41c0757/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 9989221..bbd3924 100644
--- a/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
+++ b/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
@@ -142,7 +142,7 @@ public class OutboundTcpConnection extends Thread
                     break;
                 continue;
             }
-            if (qm.timestamp < System.currentTimeMillis() - m.getTimeout())
+            if (qm.isTimedOut(m.getTimeout()))
                 dropped.incrementAndGet();
             else if (socket != null || connect())
                 writeConnected(qm);
@@ -474,17 +474,25 @@ public class OutboundTcpConnection extends Thread
         final MessageOut<?> message;
         final String id;
         final long timestamp;
+        final boolean droppable;
 
         QueuedMessage(MessageOut<?> message, String id)
         {
             this.message = message;
             this.id = id;
             this.timestamp = System.currentTimeMillis();
+            this.droppable = MessagingService.DROPPABLE_VERBS.contains(message.verb);
+        }
+
+        /** don't drop a non-droppable message just because it's timestamp is expired */
+        boolean isTimedOut(long maxTime)
+        {
+            return droppable && timestamp < System.currentTimeMillis() - maxTime;
         }
 
         boolean shouldRetry()
         {
-            return !MessagingService.DROPPABLE_VERBS.contains(message.verb);
+            return !droppable;
         }
     }
 


Mime
View raw message