Return-Path: Delivered-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Received: (qmail 99406 invoked from network); 14 Dec 2010 02:32:26 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 14 Dec 2010 02:32:26 -0000 Received: (qmail 29317 invoked by uid 500); 14 Dec 2010 02:32:26 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 29229 invoked by uid 500); 14 Dec 2010 02:32:26 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-issues@hadoop.apache.org Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 29221 invoked by uid 99); 14 Dec 2010 02:32:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Dec 2010 02:32:26 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Dec 2010 02:32:23 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id oBE2W1rj009732 for ; Tue, 14 Dec 2010 02:32:01 GMT Message-ID: <33053374.105761292293921694.JavaMail.jira@thor> Date: Mon, 13 Dec 2010 21:32:01 -0500 (EST) From: "Luke Lu (JIRA)" To: common-issues@hadoop.apache.org Subject: [jira] Commented: (HADOOP-7055) Update of commons logging libraries causes EventCounter to count logging events incorrectly In-Reply-To: <15581131.20741291107311011.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HADOOP-7055?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12971129#action_12971129 ] Luke Lu commented on HADOOP-7055: --------------------------------- This looks like a regression in the common log 1.1.1 implementation (passes in Priority.* instances instead of recommended Level.*) to me. Priority.* are deprecated and they should just use Level.* everywhere. In any case, using equals is a reasonable fix that works with all cases and the performance overhead is negligible compared with actual logging by time the appender is triggered. > Update of commons logging libraries causes EventCounter to count logging events incorrectly > ------------------------------------------------------------------------------------------- > > Key: HADOOP-7055 > URL: https://issues.apache.org/jira/browse/HADOOP-7055 > Project: Hadoop Common > Issue Type: Bug > Components: metrics > Affects Versions: 0.21.0, 0.21.1, 0.22.0, 0.23.0 > Reporter: Jingguo Yao > Fix For: 0.21.1, 0.22.0, 0.23.0 > > Original Estimate: 0.5h > Remaining Estimate: 0.5h > > Hadoop 0.20.2 uses commons logging 1.0.4. EventCounter works correctly with this version of commons logging. Hadoop 0.21.0 uses commons logging 1.1.1 which causes EventCounter to count logging events incorrectly. I have verified it with Hadoop 0.21.0. After start-up of hadoop, I checked jvmmetrics.log after several minutes. In every metrics record, "logError=0, logFatal=0, logInfo=3, logWarn=0" was shown. The following text is an example. > jvm.metrics: hostName=jingguolin, processName=DataNode, sessionId=, gcCount=3, gcTimeMillis=31, logError=0, logFatal=0, logInfo=3, logWarn=0, maxMemoryM=888.9375, memHeapCommittedM=38.0625, memHeapUsedM=3.6539612, memNonHeapCommittedM=18.25, memNonHeapUsedM=11.335686, threadsBlocked=0, threadsNew=0, threadsRunnable=8, threadsTerminated=0, threadsTimedWaiting=6, threadsWaiting=6 > Then I stopped hadoop and replaced commons logging 1.1.1 with 1.0.4. After the re-start of hadoop, a lot of logging events showed up in jvmmetrics.log. > I have checked the source code of Log4JLogger for both 1.0.4 (http://svn.apache.org/viewvc/commons/proper/logging/tags/LOGGING_1_0_4/src/java/org/apache/commons/logging/impl/Log4JLogger.java?view=markup) and 1.1.1 (http://svn.apache.org/viewvc/commons/proper/logging/tags/commons-logging-1.1.1/src/java/org/apache/commons/logging/impl/Log4JLogger.java?view=markup). For 1.0.4, Level instances such as Level.INFO are used to construct LoggingEvent. But for 1.1.1, Priority instances such as Priority.INFO are used to construct LoggingEvent. So 1.1.1 version's event.getLevel() always returns Priority instances. EventCounter append method's "==" check always fails between a Level instance and a Priority instance. For "logInfo=3" metrics records produced by commons logging 1.1.1., I think that these 3 logging events are produced by log4j code directly instead of through commons logging API. The following code is EventCounter's append method. > public void append(LoggingEvent event) { > Level level = event.getLevel(); > if (level == Level.INFO) { > counts.incr(INFO); > } > else if (level == Level.WARN) { > counts.incr(WARN); > } > else if (level == Level.ERROR) { > counts.incr(ERROR); > } > else if (level == Level.FATAL) { > counts.incr(FATAL); > } > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.