storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ptgo...@apache.org
Subject [11/24] git commit: Fixed negative netty sleep values.
Date Tue, 19 Nov 2013 15:26:48 GMT
Fixed negative netty sleep values.


Project: http://git-wip-us.apache.org/repos/asf/incubator-storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-storm/commit/213102b3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-storm/tree/213102b3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-storm/diff/213102b3

Branch: refs/heads/master
Commit: 213102b36f89002e1f84615b3c1162aff707073f
Parents: 1e3d266
Author: Brenden Matthews <brenden@diddyinc.com>
Authored: Fri Oct 18 12:08:02 2013 -0700
Committer: Brenden Matthews <brenden@diddyinc.com>
Committed: Fri Oct 18 15:39:43 2013 -0700

----------------------------------------------------------------------
 storm-netty/src/jvm/backtype/storm/messaging/netty/Client.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/213102b3/storm-netty/src/jvm/backtype/storm/messaging/netty/Client.java
----------------------------------------------------------------------
diff --git a/storm-netty/src/jvm/backtype/storm/messaging/netty/Client.java b/storm-netty/src/jvm/backtype/storm/messaging/netty/Client.java
index be8ab38..00431d4 100644
--- a/storm-netty/src/jvm/backtype/storm/messaging/netty/Client.java
+++ b/storm-netty/src/jvm/backtype/storm/messaging/netty/Client.java
@@ -93,9 +93,12 @@ class Client implements IConnection {
      */
     private int getSleepTimeMs()
     {
-        int sleepMs = base_sleep_ms * Math.max(1, random.nextInt(1 << retries.get()));
+        int backoff = 1 << Math.max(1, retries.get());
+        int sleepMs = base_sleep_ms * Math.max(1, random.nextInt(backoff));
         if ( sleepMs > max_sleep_ms )
             sleepMs = max_sleep_ms;
+        if ( sleepMs < base_sleep_ms )
+          sleepMs = base_sleep_ms;
         return sleepMs;
     }
 


Mime
View raw message