Return-Path: X-Original-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8FFE0C9AF for ; Thu, 31 May 2012 00:18:23 +0000 (UTC) Received: (qmail 49082 invoked by uid 500); 31 May 2012 00:18:23 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 49059 invoked by uid 500); 31 May 2012 00:18:23 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-issues@hadoop.apache.org Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 49042 invoked by uid 99); 31 May 2012 00:18:23 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 May 2012 00:18:23 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 08CE6142857 for ; Thu, 31 May 2012 00:18:23 +0000 (UTC) Date: Thu, 31 May 2012 00:18:23 +0000 (UTC) From: "Tsz Wo (Nicholas), SZE (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: <1729621418.19626.1338423503038.JavaMail.jiratomcat@issues-vm> In-Reply-To: <1914024802.10546.1337748521074.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Commented] (HDFS-3456) blockReportInterval is long value but when we take the random value it uses getRandom().nextInt,it is causing frequently BR 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/HDFS-3456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13286223#comment-13286223 ] Tsz Wo (Nicholas), SZE commented on HDFS-3456: ---------------------------------------------- > Well, I was going by http://docs.oracle.com/javase/1.4.2/docs/api/java/util/Random.html#nextDouble%28%29, which includes this text: Colin, you are right that there is a bug in the 1.4.2 javadoc you read but it was already fixed in Java 6 (http://docs.oracle.com/javase/6/docs/api/java/util/Random.html#nextDouble%28%29). They removed "All 2^53 possible float values ..." > blockReportInterval is long value but when we take the random value it uses getRandom().nextInt,it is causing frequently BR > --------------------------------------------------------------------------------------------------------------------------- > > Key: HDFS-3456 > URL: https://issues.apache.org/jira/browse/HDFS-3456 > Project: Hadoop HDFS > Issue Type: Bug > Components: data-node > Affects Versions: 2.0.0-alpha > Reporter: Brahma Reddy Battula > Assignee: Colin Patrick McCabe > Priority: Minor > Attachments: HDFS-3456.001.patch, HDFS-3456.002.patch, HDFS-3456.003.patch, HDFS-3456.004.patch > > > blockReportInterval is long value but when we take the random value it uses getRandom().nextInt. > Due to this, offerService can throw exception as long may get rotated to negative value. > So, block report may send very frequently. > {code} > if (resetBlockReportTime) { > lastBlockReport = startTime - DFSUtil.getRandom().nextInt((int)(dnConf.blockReportInterval)); > resetBlockReportTime = false; > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira