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 30FC8CF3F for ; Fri, 1 Jun 2012 00:47:24 +0000 (UTC) Received: (qmail 85718 invoked by uid 500); 1 Jun 2012 00:47:23 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 85652 invoked by uid 500); 1 Jun 2012 00:47: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 85597 invoked by uid 99); 1 Jun 2012 00:47:23 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Jun 2012 00:47:23 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 9E0CF142857 for ; Fri, 1 Jun 2012 00:47:23 +0000 (UTC) Date: Fri, 1 Jun 2012 00:47:23 +0000 (UTC) From: "Andy Isaacson (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: <1788851650.24645.1338511643651.JavaMail.jiratomcat@issues-vm> In-Reply-To: <341508924.23098.1338489684126.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Commented] (HDFS-3485) DataTransferThrottler will over-throttle when currentTimeMillis jumps 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-3485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13287063#comment-13287063 ] Andy Isaacson commented on HDFS-3485: ------------------------------------- Yes, it is a little unfortunate, there is a tiny optimization that we miss out on here, we could save a few hundred clock cycles if we could use CLOCK_MONOTONIC_COARSE. But, on modern systems the overhead of CLOCK_MONOTONIC (which presumably backs nanoTime()) is not that much greater than CLOCK_MONOTONIC_COARSE, and is probably the same as gettimeofday() which presumably backs currentTimeMillis(). > DataTransferThrottler will over-throttle when currentTimeMillis jumps > --------------------------------------------------------------------- > > Key: HDFS-3485 > URL: https://issues.apache.org/jira/browse/HDFS-3485 > Project: Hadoop HDFS > Issue Type: Bug > Affects Versions: 2.0.0-alpha > Reporter: Andy Isaacson > Assignee: Andy Isaacson > Priority: Minor > Attachments: hdfs-3485.patch > > > When the system clock is set backwards, DataTransferThrottler will simply pause until the clock reaches the end of the previously calculated transfer period: > {code} > this.curPeriodStart = System.currentTimeMillis(); > ... > while (curReserve <= 0) { > long now = System.currentTimeMillis(); > long curPeriodEnd = curPeriodStart + period; > if ( now < curPeriodEnd ) { > try { > wait( curPeriodEnd - now ); > {code} > Instead of using currentTimeMillis() which is affected by system-clock-changes, this code should use nanoTime which ticks forward monotonically. -- 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