Hadoop Common
  1. Hadoop Common
  2. HADOOP-8177

MBeans shouldn't try to register when it fails to create MBeanName

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.24.0
    • Fix Version/s: 3.0.0
    • Component/s: metrics
    • Labels:
      None
    • Hadoop Flags:
      Reviewed
    • Target Version/s:

      Description

      MBeans.java
        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;
        }
      

      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"'.

        Activity

        Arun C Murthy made changes -
        Fix Version/s 3.0.0 [ 12320357 ]
        Fix Version/s 0.24.0 [ 12317652 ]
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Mapreduce-trunk #1023 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1023/)
        HADOOP-8177. MBeans shouldn't try to register when it fails to create MBeanName. (Contributed by Devaraj K). (Revision 1302067)

        Result = SUCCESS
        umamahesh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1302067
        Files :

        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/util/MBeans.java
        Show
        Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk #1023 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1023/ ) HADOOP-8177 . MBeans shouldn't try to register when it fails to create MBeanName. (Contributed by Devaraj K). (Revision 1302067) Result = SUCCESS umamahesh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1302067 Files : /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/util/MBeans.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-trunk #988 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/988/)
        HADOOP-8177. MBeans shouldn't try to register when it fails to create MBeanName. (Contributed by Devaraj K). (Revision 1302067)

        Result = SUCCESS
        umamahesh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1302067
        Files :

        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/util/MBeans.java
        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-trunk #988 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/988/ ) HADOOP-8177 . MBeans shouldn't try to register when it fails to create MBeanName. (Contributed by Devaraj K). (Revision 1302067) Result = SUCCESS umamahesh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1302067 Files : /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/util/MBeans.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Mapreduce-trunk-Commit #1906 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/1906/)
        HADOOP-8177. MBeans shouldn't try to register when it fails to create MBeanName. (Contributed by Devaraj K). (Revision 1302067)

        Result = ABORTED
        umamahesh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1302067
        Files :

        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/util/MBeans.java
        Show
        Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk-Commit #1906 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/1906/ ) HADOOP-8177 . MBeans shouldn't try to register when it fails to create MBeanName. (Contributed by Devaraj K). (Revision 1302067) Result = ABORTED umamahesh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1302067 Files : /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/util/MBeans.java
        Uma Maheswara Rao G made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Hadoop Flags Reviewed [ 10343 ]
        Fix Version/s 0.24.0 [ 12317652 ]
        Resolution Fixed [ 1 ]
        Hide
        Uma Maheswara Rao G added a comment -

        I have committed this to trunk. Thanks Deva.

        Show
        Uma Maheswara Rao G added a comment - I have committed this to trunk. Thanks Deva.
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Common-trunk-Commit #1898 (See https://builds.apache.org/job/Hadoop-Common-trunk-Commit/1898/)
        HADOOP-8177. MBeans shouldn't try to register when it fails to create MBeanName. (Contributed by Devaraj K). (Revision 1302067)

        Result = SUCCESS
        umamahesh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1302067
        Files :

        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/util/MBeans.java
        Show
        Hudson added a comment - Integrated in Hadoop-Common-trunk-Commit #1898 (See https://builds.apache.org/job/Hadoop-Common-trunk-Commit/1898/ ) HADOOP-8177 . MBeans shouldn't try to register when it fails to create MBeanName. (Contributed by Devaraj K). (Revision 1302067) Result = SUCCESS umamahesh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1302067 Files : /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/util/MBeans.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-trunk-Commit #1972 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/1972/)
        HADOOP-8177. MBeans shouldn't try to register when it fails to create MBeanName. (Contributed by Devaraj K). (Revision 1302067)

        Result = SUCCESS
        umamahesh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1302067
        Files :

        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/util/MBeans.java
        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-trunk-Commit #1972 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/1972/ ) HADOOP-8177 . MBeans shouldn't try to register when it fails to create MBeanName. (Contributed by Devaraj K). (Revision 1302067) Result = SUCCESS umamahesh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1302067 Files : /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/util/MBeans.java
        Hide
        Uma Maheswara Rao G added a comment -

        Already filed JIRA for test failure. HADOOP-8110.
        Will commit this patch momentarily.

        Show
        Uma Maheswara Rao G added a comment - Already filed JIRA for test failure. HADOOP-8110 . Will commit this patch momentarily.
        Uma Maheswara Rao G made changes -
        Priority Major [ 3 ] Minor [ 4 ]
        Hide
        Uma Maheswara Rao G added a comment -

        Thanks Deva, for the patch.
        +1
        Anyway null can not be registered. Registration with null would be unnecessary.

        Show
        Uma Maheswara Rao G added a comment - Thanks Deva, for the patch. +1 Anyway null can not be registered. Registration with null would be unnecessary.
        Hide
        Devaraj K added a comment -

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

        It doesn't need new tests since it is related to log message.

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

        This test failure doesn't relate to the patch.

        Show
        Devaraj K added a comment - -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. It doesn't need new tests since it is related to log message. -1 core tests. The patch failed these unit tests: org.apache.hadoop.fs.viewfs.TestViewFsTrash This test failure doesn't relate to the patch.
        Hide
        Hadoop QA added a comment -

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

        Show
        Hadoop QA added a comment - -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.
        Devaraj K made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Target Version/s 0.24.0 [ 12317652 ]
        Hide
        Devaraj K added a comment -

        Attached a patch to fix this.

        Show
        Devaraj K added a comment - Attached a patch to fix this.
        Devaraj K made changes -
        Field Original Value New Value
        Attachment HADOOP-8177.patch [ 12518647 ]
        Devaraj K created issue -

          People

          • Assignee:
            Devaraj K
            Reporter:
            Devaraj K
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development