From 8d559d2d9a09f076689cf95621a5d087a9a7f4d8 Mon Sep 17 00:00:00 2001 From: Robert Joseph Evans Date: Thu, 31 May 2012 14:10:16 +0000 Subject: [PATCH] HADOOP-8452. DN logs backtrace when running under jsvc and /jmx is loaded (Andy Isaacson via bobby) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1344733 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++ .../src/main/java/org/apache/hadoop/jmx/JMXJsonServlet.java | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 2d3a41690d..b56a50141d 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -219,6 +219,9 @@ Release 2.0.1-alpha - UNRELEASED FileContextMainOperationsBaseTest.java to avoid potential test failure (Madhukara Phatak via harsh) + HADOOP-8452. DN logs backtrace when running under jsvc and /jmx is loaded + (Andy Isaacson via bobby) + Release 2.0.0-alpha - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/jmx/JMXJsonServlet.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/jmx/JMXJsonServlet.java index 8dc83a3c71..84dc15c882 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/jmx/JMXJsonServlet.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/jmx/JMXJsonServlet.java @@ -34,6 +34,7 @@ import javax.management.MalformedObjectNameException; import javax.management.ObjectName; import javax.management.ReflectionException; +import javax.management.RuntimeErrorException; import javax.management.RuntimeMBeanException; import javax.management.openmbean.CompositeData; import javax.management.openmbean.CompositeType; @@ -317,6 +318,11 @@ private void writeAttribute(JsonGenerator jg, ObjectName oname, MBeanAttributeIn LOG.error("getting attribute "+attName+" of "+oname+" threw an exception", e); } return; + } catch (RuntimeErrorException e) { + // RuntimeErrorException happens when an unexpected failure occurs in getAttribute + // for example https://issues.apache.org/jira/browse/DAEMON-120 + LOG.debug("getting attribute "+attName+" of "+oname+" threw an exception", e); + return; } catch (AttributeNotFoundException e) { //Ignored the attribute was not found, which should never happen because the bean //just told us that it has this attribute, but if this happens just don't output