You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Hadoop QA (Commented) (JIRA)" <ji...@apache.org> on 2012/03/16 16:09:39 UTC

[jira] [Commented] (HADOOP-8177) MBeans shouldn't try to register when it fails to create MBeanName

    [ https://issues.apache.org/jira/browse/HADOOP-8177?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13231279#comment-13231279 ] 

Hadoop QA commented on HADOOP-8177:
-----------------------------------

-1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12518647/HADOOP-8177.patch
  against trunk revision .

    +1 @author.  The patch does not contain any @author tags.

    -1 tests included.  The patch doesn't appear to include any new or modified tests.
                        Please justify why no new tests are needed for this patch.
                        Also please list what manual steps were performed to verify this patch.

    +1 javadoc.  The javadoc tool did not generate any warning messages.

    +1 javac.  The applied patch does not increase the total number of javac compiler warnings.

    +1 eclipse:eclipse.  The patch built with eclipse:eclipse.

    +1 findbugs.  The patch does not introduce any new Findbugs (version 1.3.9) warnings.

    +1 release audit.  The applied patch does not increase the total number of release audit warnings.

    -1 core tests.  The patch failed these unit tests:
                  org.apache.hadoop.fs.viewfs.TestViewFsTrash

    +1 contrib tests.  The patch passed contrib unit tests.

Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/720//testReport/
Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/720//console

This message is automatically generated.
                
> MBeans shouldn't try to register when it fails to create MBeanName
> ------------------------------------------------------------------
>
>                 Key: HADOOP-8177
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8177
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: metrics
>    Affects Versions: 0.24.0
>            Reporter: Devaraj K
>            Assignee: Devaraj K
>         Attachments: HADOOP-8177.patch
>
>
> {code:title=MBeans.java|borderStyle=solid}
>   static public ObjectName register(String serviceName, String nameName,
>                                     Object theMbean) {
>     final MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
>     ObjectName name = getMBeanName(serviceName, nameName);
>     try {
>       mbs.registerMBean(theMbean, name);
>       LOG.debug("Registered "+ name);
>       return name;
>     } catch (InstanceAlreadyExistsException iaee) {
>       if (LOG.isTraceEnabled()) {
>         LOG.trace("Failed to register MBean \""+ name + "\"", iaee);
>       } else {
>         LOG.warn("Failed to register MBean \""+ name
>             + "\": Instance already exists.");
>       }
>     } catch (Exception e) {
>       LOG.warn("Failed to register MBean \""+ name + "\"", e);
>     }
>     return null;
>   }
>   static private ObjectName getMBeanName(String serviceName, String nameName) {
>     ObjectName name = null;
>     String nameStr = "Hadoop:service="+ serviceName +",name="+ nameName;
>     try {
>       name = DefaultMetricsSystem.newMBeanName(nameStr);
>     } catch (Exception e) {
>       LOG.warn("Error creating MBean object name: "+ nameStr, e);
>     }
>     return name;
>   }
> {code}
> In getMBeanName() if DefaultMetricsSystem.newMBeanName(nameStr); fails with some reason like mbean already exists, getMBeanName() logs the exception and returns null and  mbs.registerMBean(theMbean, name) in register() tries to register with null and throws exception with the message 'Failed to register MBean "null"'.

--
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