Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8693418FEF for ; Wed, 4 Nov 2015 09:49:29 +0000 (UTC) Received: (qmail 56663 invoked by uid 500); 4 Nov 2015 09:49:28 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 56365 invoked by uid 500); 4 Nov 2015 09:49:27 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 56257 invoked by uid 99); 4 Nov 2015 09:49:27 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Nov 2015 09:49:27 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id A7BEB2C14E1 for ; Wed, 4 Nov 2015 09:49:27 +0000 (UTC) Date: Wed, 4 Nov 2015 09:49:27 +0000 (UTC) From: "Duo Zhang (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (HBASE-14759) Avoid using Math.abs when selecting SyncRunner in FSHLog MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Duo Zhang created HBASE-14759: --------------------------------- Summary: Avoid using Math.abs when selecting SyncRunner in FSHLog Key: HBASE-14759 URL: https://issues.apache.org/jira/browse/HBASE-14759 Project: HBase Issue Type: Bug Components: wal Reporter: Duo Zhang {code:title=FSHLog.java} int index = Math.abs(this.syncRunnerIndex++) % this.syncRunners.length; try { this.syncRunners[index].offer(sequence, this.syncFutures, this.syncFuturesCount); } catch (Exception e) { // Should NEVER get here. requestLogRoll(); this.exception = new DamagedWALException("Failed offering sync", e); } {code} Math.abs will return Integer.MIN_VALUE if you pass Integer.MIN_VALUE in since the actual absolute value of Integer.MIN_VALUE is out of range. I think {{this.syncRunnerIndex++}} will overflow eventually if we keep the regionserver running for enough time. -- This message was sent by Atlassian JIRA (v6.3.4#6332)