cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From goffi...@apache.org
Subject svn commit: r927610 - in /cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra: net/AsyncResult.java service/QuorumResponseHandler.java service/WriteResponseHandler.java
Date Thu, 25 Mar 2010 22:23:30 GMT
Author: goffinet
Date: Thu Mar 25 22:23:30 2010
New Revision: 927610

URL: http://svn.apache.org/viewvc?rev=927610&view=rev
Log:
CASSANDRA-911 fixed incorrect timeout calculations. Patch by Roger Schildmeijer and Kelvin
Kakugawa, reviewed by Chris Goffinet.

Modified:
    cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/net/AsyncResult.java
    cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/QuorumResponseHandler.java
    cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/WriteResponseHandler.java

Modified: cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/net/AsyncResult.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/net/AsyncResult.java?rev=927610&r1=927609&r2=927610&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/net/AsyncResult.java (original)
+++ cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/net/AsyncResult.java Thu
Mar 25 22:23:30 2010
@@ -78,7 +78,7 @@ class AsyncResult implements IAsyncResul
             {
                 if ( !done_.get() )
                 {
-                    long overall_timeout = System.currentTimeMillis() - startTime_ + timeout;
+                    long overall_timeout = timeout - (System.currentTimeMillis() - startTime_);
                     if(overall_timeout > 0)
                         bVal = condition_.await(overall_timeout, TimeUnit.MILLISECONDS);
                     else

Modified: cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/QuorumResponseHandler.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/QuorumResponseHandler.java?rev=927610&r1=927609&r2=927610&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/QuorumResponseHandler.java
(original)
+++ cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/QuorumResponseHandler.java
Thu Mar 25 22:23:30 2010
@@ -54,7 +54,7 @@ public class QuorumResponseHandler<T> im
     {
         try
         {
-            long timeout = System.currentTimeMillis() - startTime + DatabaseDescriptor.getRpcTimeout();
+            long timeout = DatabaseDescriptor.getRpcTimeout() - (System.currentTimeMillis()
- startTime);
             boolean success;
             try
             {

Modified: cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/WriteResponseHandler.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/WriteResponseHandler.java?rev=927610&r1=927609&r2=927610&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/WriteResponseHandler.java
(original)
+++ cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/WriteResponseHandler.java
Thu Mar 25 22:23:30 2010
@@ -61,7 +61,7 @@ public class WriteResponseHandler implem
     {
         try
         {
-            long timeout = System.currentTimeMillis() - startTime + DatabaseDescriptor.getRpcTimeout();
+            long timeout = DatabaseDescriptor.getRpcTimeout() - (System.currentTimeMillis()
- startTime);
             boolean success;
             try
             {



Mime
View raw message