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 78862177F3 for ; Sat, 12 Sep 2015 20:08:46 +0000 (UTC) Received: (qmail 23211 invoked by uid 500); 12 Sep 2015 20:08:46 -0000 Delivered-To: apmail-curator-dev-archive@curator.apache.org Received: (qmail 23023 invoked by uid 500); 12 Sep 2015 20:08:46 -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 22787 invoked by uid 99); 12 Sep 2015 20:08:46 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 12 Sep 2015 20:08:46 +0000 Date: Sat, 12 Sep 2015 20:08:46 +0000 (UTC) From: "Dimitar Dyankov (JIRA)" To: dev@curator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (CURATOR-262) Issue with ExponentialBackoffRetry MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Dimitar Dyankov created CURATOR-262: --------------------------------------- Summary: 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)