You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@curator.apache.org by ca...@apache.org on 2016/05/24 22:32:25 UTC

[1/2] curator git commit: CURATOR-262: Fixed integer overflow issue with sleepMs

Repository: curator
Updated Branches:
  refs/heads/CURATOR-262 [created] 6ae3f8591


CURATOR-262: Fixed integer overflow issue with sleepMs


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

Branch: refs/heads/CURATOR-262
Commit: 630c009a410eff13c4428704700d566abe417bda
Parents: 33c19d6
Author: Dimitar Dyankov <dd...@gmail.com>
Authored: Thu Feb 25 16:23:38 2016 -0800
Committer: Dimitar Dyankov <dd...@gmail.com>
Committed: Thu Feb 25 16:23:38 2016 -0800

----------------------------------------------------------------------
 .../org/apache/curator/retry/BoundedExponentialBackoffRetry.java | 2 +-
 .../java/org/apache/curator/retry/ExponentialBackoffRetry.java   | 4 ++--
 .../src/main/java/org/apache/curator/retry/RetryNTimes.java      | 2 +-
 .../main/java/org/apache/curator/retry/RetryUntilElapsed.java    | 2 +-
 .../src/main/java/org/apache/curator/retry/SleepingRetry.java    | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/630c009a/curator-client/src/main/java/org/apache/curator/retry/BoundedExponentialBackoffRetry.java
----------------------------------------------------------------------
diff --git a/curator-client/src/main/java/org/apache/curator/retry/BoundedExponentialBackoffRetry.java b/curator-client/src/main/java/org/apache/curator/retry/BoundedExponentialBackoffRetry.java
index f31da61..3c9d3cd 100644
--- a/curator-client/src/main/java/org/apache/curator/retry/BoundedExponentialBackoffRetry.java
+++ b/curator-client/src/main/java/org/apache/curator/retry/BoundedExponentialBackoffRetry.java
@@ -45,7 +45,7 @@ public class BoundedExponentialBackoffRetry extends ExponentialBackoffRetry
     }
 
     @Override
-    protected int getSleepTimeMs(int retryCount, long elapsedTimeMs)
+    protected long getSleepTimeMs(int retryCount, long elapsedTimeMs)
     {
         return Math.min(maxSleepTimeMs, super.getSleepTimeMs(retryCount, elapsedTimeMs));
     }

http://git-wip-us.apache.org/repos/asf/curator/blob/630c009a/curator-client/src/main/java/org/apache/curator/retry/ExponentialBackoffRetry.java
----------------------------------------------------------------------
diff --git a/curator-client/src/main/java/org/apache/curator/retry/ExponentialBackoffRetry.java b/curator-client/src/main/java/org/apache/curator/retry/ExponentialBackoffRetry.java
index 1aed9a8..421e2b2 100644
--- a/curator-client/src/main/java/org/apache/curator/retry/ExponentialBackoffRetry.java
+++ b/curator-client/src/main/java/org/apache/curator/retry/ExponentialBackoffRetry.java
@@ -65,10 +65,10 @@ public class ExponentialBackoffRetry extends SleepingRetry
     }
 
     @Override
-    protected int getSleepTimeMs(int retryCount, long elapsedTimeMs)
+    protected long getSleepTimeMs(int retryCount, long elapsedTimeMs)
     {
         // copied from Hadoop's RetryPolicies.java
-        int sleepMs = baseSleepTimeMs * Math.max(1, random.nextInt(1 << (retryCount + 1)));
+        long sleepMs = baseSleepTimeMs * Math.max(1, random.nextInt(1 << (retryCount + 1)));
         if ( sleepMs > maxSleepMs )
         {
             log.warn(String.format("Sleep extension too large (%d). Pinning to %d", sleepMs, maxSleepMs));

http://git-wip-us.apache.org/repos/asf/curator/blob/630c009a/curator-client/src/main/java/org/apache/curator/retry/RetryNTimes.java
----------------------------------------------------------------------
diff --git a/curator-client/src/main/java/org/apache/curator/retry/RetryNTimes.java b/curator-client/src/main/java/org/apache/curator/retry/RetryNTimes.java
index 6e0ff0e..234b241 100644
--- a/curator-client/src/main/java/org/apache/curator/retry/RetryNTimes.java
+++ b/curator-client/src/main/java/org/apache/curator/retry/RetryNTimes.java
@@ -32,7 +32,7 @@ public class RetryNTimes extends SleepingRetry
     }
 
     @Override
-    protected int getSleepTimeMs(int retryCount, long elapsedTimeMs)
+    protected long getSleepTimeMs(int retryCount, long elapsedTimeMs)
     {
         return sleepMsBetweenRetries;
     }

http://git-wip-us.apache.org/repos/asf/curator/blob/630c009a/curator-client/src/main/java/org/apache/curator/retry/RetryUntilElapsed.java
----------------------------------------------------------------------
diff --git a/curator-client/src/main/java/org/apache/curator/retry/RetryUntilElapsed.java b/curator-client/src/main/java/org/apache/curator/retry/RetryUntilElapsed.java
index cd1953c..3b11268 100644
--- a/curator-client/src/main/java/org/apache/curator/retry/RetryUntilElapsed.java
+++ b/curator-client/src/main/java/org/apache/curator/retry/RetryUntilElapsed.java
@@ -42,7 +42,7 @@ public class RetryUntilElapsed extends SleepingRetry
     }
 
     @Override
-    protected int getSleepTimeMs(int retryCount, long elapsedTimeMs)
+    protected long getSleepTimeMs(int retryCount, long elapsedTimeMs)
     {
         return sleepMsBetweenRetries;
     }

http://git-wip-us.apache.org/repos/asf/curator/blob/630c009a/curator-client/src/main/java/org/apache/curator/retry/SleepingRetry.java
----------------------------------------------------------------------
diff --git a/curator-client/src/main/java/org/apache/curator/retry/SleepingRetry.java b/curator-client/src/main/java/org/apache/curator/retry/SleepingRetry.java
index 6f0a1fb..22d2b33 100644
--- a/curator-client/src/main/java/org/apache/curator/retry/SleepingRetry.java
+++ b/curator-client/src/main/java/org/apache/curator/retry/SleepingRetry.java
@@ -55,5 +55,5 @@ abstract class SleepingRetry implements RetryPolicy
         return false;
     }
 
-    protected abstract int   getSleepTimeMs(int retryCount, long elapsedTimeMs);
+    protected abstract long   getSleepTimeMs(int retryCount, long elapsedTimeMs);
 }


[2/2] curator git commit: Merge branch 'CURATOR-262' of https://github.com/ddyankov/curator into CURATOR-262

Posted by ca...@apache.org.
Merge branch 'CURATOR-262' of https://github.com/ddyankov/curator into CURATOR-262


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

Branch: refs/heads/CURATOR-262
Commit: 6ae3f8591f5e2b31d4b53ac734df231b20408a5b
Parents: d63e06e 630c009
Author: Cam McKenzie <ca...@apache.org>
Authored: Wed May 25 08:15:16 2016 +1000
Committer: Cam McKenzie <ca...@apache.org>
Committed: Wed May 25 08:15:16 2016 +1000

----------------------------------------------------------------------
 .../org/apache/curator/retry/BoundedExponentialBackoffRetry.java | 2 +-
 .../java/org/apache/curator/retry/ExponentialBackoffRetry.java   | 4 ++--
 .../src/main/java/org/apache/curator/retry/RetryNTimes.java      | 2 +-
 .../main/java/org/apache/curator/retry/RetryUntilElapsed.java    | 2 +-
 .../src/main/java/org/apache/curator/retry/SleepingRetry.java    | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------