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 "Devaraj K (Created) (JIRA)" <ji...@apache.org> on 2012/03/16 07:43:53 UTC

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

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


{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

        

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

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8177?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13232278#comment-13232278 ] 

Hudson commented on HADOOP-8177:
--------------------------------

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

                
> 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
>            Priority: Minor
>             Fix For: 0.24.0
>
>         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

        

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

Posted by "Devaraj K (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-8177?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Devaraj K updated HADOOP-8177:
------------------------------

    Attachment: HADOOP-8177.patch
    
> 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

        

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

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8177?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13232181#comment-13232181 ] 

Hudson commented on HADOOP-8177:
--------------------------------

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

                
> 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
>            Priority: Minor
>         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

        

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

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8177?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13232182#comment-13232182 ] 

Hudson commented on HADOOP-8177:
--------------------------------

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

                
> 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
>            Priority: Minor
>         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

        

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

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8177?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13232194#comment-13232194 ] 

Hudson commented on HADOOP-8177:
--------------------------------

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

                
> 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
>            Priority: Minor
>             Fix For: 0.24.0
>
>         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

        

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

Posted by "Uma Maheswara Rao G (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8177?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13232128#comment-13232128 ] 

Uma Maheswara Rao G commented on HADOOP-8177:
---------------------------------------------

Thanks Deva, for the patch.
+1
Anyway null can not be registered. Registration with null would be unnecessary.
                
> 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

        

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

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8177?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13232268#comment-13232268 ] 

Hudson commented on HADOOP-8177:
--------------------------------

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

                
> 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
>            Priority: Minor
>             Fix For: 0.24.0
>
>         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

        

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

Posted by "Devaraj K (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8177?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13231317#comment-13231317 ] 

Devaraj K commented on HADOOP-8177:
-----------------------------------

{quote}
-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.
{quote}
It doesn't need new tests since it is related to log message.

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

This test failure doesn't relate to the patch.
                
> 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

        

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

Posted by "Uma Maheswara Rao G (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-8177?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Uma Maheswara Rao G updated HADOOP-8177:
----------------------------------------

       Resolution: Fixed
    Fix Version/s: 0.24.0
     Hadoop Flags: Reviewed
           Status: Resolved  (was: Patch Available)

I have committed this to trunk. Thanks Deva.
                
> 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
>            Priority: Minor
>             Fix For: 0.24.0
>
>         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

        

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

Posted by "Uma Maheswara Rao G (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8177?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13232168#comment-13232168 ] 

Uma Maheswara Rao G commented on HADOOP-8177:
---------------------------------------------

Already filed JIRA for test failure. HADOOP-8110.
Will commit this patch momentarily.
                
> 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
>            Priority: Minor
>         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

        

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

Posted by "Devaraj K (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-8177?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Devaraj K updated HADOOP-8177:
------------------------------

    Target Version/s: 0.24.0
              Status: Patch Available  (was: Open)

Attached a patch to fix this.
                
> 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

        

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

Posted by "Hadoop QA (Commented) (JIRA)" <ji...@apache.org>.
    [ 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

        

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

Posted by "Uma Maheswara Rao G (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-8177?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Uma Maheswara Rao G updated HADOOP-8177:
----------------------------------------

    Priority: Minor  (was: Major)
    
> 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
>            Priority: Minor
>         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