Return-Path: Delivered-To: apmail-lucene-hadoop-commits-archive@locus.apache.org Received: (qmail 38372 invoked from network); 24 Oct 2007 23:32:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Oct 2007 23:32:11 -0000 Received: (qmail 47960 invoked by uid 500); 24 Oct 2007 23:31:58 -0000 Delivered-To: apmail-lucene-hadoop-commits-archive@lucene.apache.org Received: (qmail 47925 invoked by uid 500); 24 Oct 2007 23:31:58 -0000 Mailing-List: contact hadoop-commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hadoop-dev@lucene.apache.org Delivered-To: mailing list hadoop-commits@lucene.apache.org Received: (qmail 47916 invoked by uid 99); 24 Oct 2007 23:31:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Oct 2007 16:31:58 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Oct 2007 23:32:10 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 57D871A9832; Wed, 24 Oct 2007 16:31:50 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r588083 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/util/ReflectionUtils.java Date: Wed, 24 Oct 2007 23:31:50 -0000 To: hadoop-commits@lucene.apache.org From: omalley@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20071024233150.57D871A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: omalley Date: Wed Oct 24 16:31:49 2007 New Revision: 588083 URL: http://svn.apache.org/viewvc?rev=588083&view=rev Log: HADOOP-1898. Release the lock protecting the last time of the last stack dump while the dump is happening. Contributed by Amareshwari Sri Ramadasu. Modified: lucene/hadoop/trunk/CHANGES.txt lucene/hadoop/trunk/src/java/org/apache/hadoop/util/ReflectionUtils.java Modified: lucene/hadoop/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?rev=588083&r1=588082&r2=588083&view=diff ============================================================================== --- lucene/hadoop/trunk/CHANGES.txt (original) +++ lucene/hadoop/trunk/CHANGES.txt Wed Oct 24 16:31:49 2007 @@ -24,6 +24,11 @@ HADOOP-1604. An system administrator can finalize namenode upgrades without running the cluster. (Konstantin Shvachko via dhruba) + OPTIMIZATIONS + + HADOOP-1898. Release the lock protecting the last time of the last stack + dump while the dump is happening. (Amareshwari Sri Ramadasu via omalley) + Branch 0.15 (unreleased changes) INCOMPATIBLE CHANGES Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/util/ReflectionUtils.java URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/util/ReflectionUtils.java?rev=588083&r1=588082&r2=588083&view=diff ============================================================================== --- lucene/hadoop/trunk/src/java/org/apache/hadoop/util/ReflectionUtils.java (original) +++ lucene/hadoop/trunk/src/java/org/apache/hadoop/util/ReflectionUtils.java Wed Oct 24 16:31:49 2007 @@ -151,13 +151,19 @@ * @param title a descriptive title for the call stacks * @param minInterval the minimum time from the last */ - public static synchronized void logThreadInfo(Log log, - String title, - long minInterval) { + public static void logThreadInfo(Log log, + String title, + long minInterval) { + boolean dumpStack = false; if (log.isInfoEnabled()) { - long now = System.currentTimeMillis(); - if (now - previousLogTime >= minInterval * 1000) { - previousLogTime = now; + synchronized (ReflectionUtils.class) { + long now = System.currentTimeMillis(); + if (now - previousLogTime >= minInterval * 1000) { + previousLogTime = now; + dumpStack = true; + } + } + if (dumpStack) { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); printThreadInfo(new PrintWriter(buffer), title); log.info(buffer.toString());