You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by pt...@apache.org on 2013/11/19 16:26:48 UTC
[11/24] git commit: Fixed negative netty sleep values.
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 <br...@diddyinc.com>
Authored: Fri Oct 18 12:08:02 2013 -0700
Committer: Brenden Matthews <br...@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;
}