Return-Path: X-Original-To: apmail-curator-dev-archive@minotaur.apache.org Delivered-To: apmail-curator-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 91582184CB for ; Thu, 25 Feb 2016 23:18:18 +0000 (UTC) Received: (qmail 20547 invoked by uid 500); 25 Feb 2016 23:18:18 -0000 Delivered-To: apmail-curator-dev-archive@curator.apache.org Received: (qmail 20493 invoked by uid 500); 25 Feb 2016 23:18:18 -0000 Mailing-List: contact dev-help@curator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@curator.apache.org Delivered-To: mailing list dev@curator.apache.org Received: (qmail 20442 invoked by uid 99); 25 Feb 2016 23:18:18 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Feb 2016 23:18:18 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 4350F2C1F58 for ; Thu, 25 Feb 2016 23:18:18 +0000 (UTC) Date: Thu, 25 Feb 2016 23:18:18 +0000 (UTC) From: "Xu Zhang (JIRA)" To: dev@curator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CURATOR-262) Issue with ExponentialBackoffRetry MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CURATOR-262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15168091#comment-15168091 ] Xu Zhang commented on CURATOR-262: ---------------------------------- Oh I see, I think you r right. > Issue with ExponentialBackoffRetry > ---------------------------------- > > Key: CURATOR-262 > URL: https://issues.apache.org/jira/browse/CURATOR-262 > Project: Apache Curator > Issue Type: Bug > Reporter: Dimitar Dyankov > Assignee: Jordan Zimmerman > > Hi, > Looking at the ExponentialBackOff Strategy for the apache curator I found this issue : > @Override > protected int getSleepTimeMs(int retryCount, long elapsedTimeMs) > { > // copied from Hadoop's RetryPolicies.java > int 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)); > sleepMs = maxSleepMs; > } > return sleepMs; > } > since sleepMs is an Integer and retryCount could be as large as 29 we could fall into an integer overflow case and therefore sleepMs being a negative number. -- This message was sent by Atlassian JIRA (v6.3.4#6332)