cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject [01/15] cassandra git commit: Add missing unit conversion when timeouting outbound messages
Date Tue, 08 Mar 2016 16:22:50 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 e01b3a94a -> e94a2a034
  refs/heads/cassandra-2.2 2971ff3b4 -> 9b53d6a5b
  refs/heads/cassandra-3.0 504760c46 -> c2b47baf3
  refs/heads/cassandra-3.5 719f584ea -> 17d1b1b04
  refs/heads/trunk 97fe1aab4 -> be20457c0


Add missing unit conversion when timeouting outbound messages

patch by slebresne; reviewed by aweisberg for CASSANDRA-11302


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

Branch: refs/heads/cassandra-2.1
Commit: e94a2a0341fc01a864968283073a0839823f3643
Parents: e01b3a9
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Tue Mar 8 10:56:42 2016 +0100
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Tue Mar 8 17:20:43 2016 +0100

----------------------------------------------------------------------
 CHANGES.txt                                                  | 1 +
 src/java/org/apache/cassandra/net/OutboundTcpConnection.java | 8 ++++----
 2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e94a2a03/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index d6b085c..e7c997a 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.14
+ * Avoid dropping message too quickly due to missing unit conversion (CASSANDRA-11302)
  * COPY FROM on large datasets: fix progress report and debug performance (CASSANDRA-11053)
  * InvalidateKeys should have a weak ref to key cache (CASSANDRA-11176)
  * Don't remove FailureDetector history on removeEndpoint (CASSANDRA-10371)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e94a2a03/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 dfebe9a..0d588c8 100644
--- a/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
+++ b/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
@@ -212,7 +212,7 @@ public class OutboundTcpConnection extends Thread
                         continue;
                     }
 
-                    if (qm.isTimedOut(TimeUnit.MILLISECONDS.toNanos(m.getTimeout()), System.nanoTime()))
+                    if (qm.isTimedOut())
                         dropped.incrementAndGet();
                     else if (socket != null || connect())
                         writeConnected(qm, count == 1 && backlog.isEmpty());
@@ -522,7 +522,7 @@ public class OutboundTcpConnection extends Thread
             QueuedMessage qm = iter.next();
             if (!qm.droppable)
                 continue;
-            if (qm.timestampNanos >= System.nanoTime() - qm.message.getTimeout())
+            if (!qm.isTimedOut())
                 return;
             iter.remove();
             dropped.incrementAndGet();
@@ -546,9 +546,9 @@ public class OutboundTcpConnection extends Thread
         }
 
         /** don't drop a non-droppable message just because it's timestamp is expired */
-        boolean isTimedOut(long maxTimeNanos, long nowNanos)
+        boolean isTimedOut()
         {
-            return droppable && timestampNanos < nowNanos - maxTimeNanos;
+            return droppable && timestampNanos < System.nanoTime() - TimeUnit.MILLISECONDS.toNanos(message.getTimeout());
         }
 
         boolean shouldRetry()


Mime
View raw message