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

ASF GitHub Bot commented on HADOOP-17468:
-----------------------------------------

github-actions[bot] closed pull request #2644: HADOOP-17468. 
NullPointerException from register in MetricsSystemImpl
URL: https://github.com/apache/hadoop/pull/2644




> NullPointerException from register in MetricsSystemImpl
> -------------------------------------------------------
>
>                 Key: HADOOP-17468
>                 URL: https://issues.apache.org/jira/browse/HADOOP-17468
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: Janus Chow
>            Assignee: Janus Chow
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> This is an error from Ozone's unit test case 
> [HDDS-4688|https://github.com/apache/ozone/pull/1795#issuecomment-760052788]. 
> The error is as follows:
>  
> {code:java}
> java.lang.NullPointerException: configjava.lang.NullPointerException: config
>  at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:897) 
> at 
> org.apache.hadoop.metrics2.impl.MetricsSystemImpl.registerSink(MetricsSystemImpl.java:298)
>  at 
> org.apache.hadoop.metrics2.impl.MetricsSystemImpl.register(MetricsSystemImpl.java:277)
>  at 
> org.apache.hadoop.hdds.server.http.BaseHttpServer.start(BaseHttpServer.java:298)
> ...{code}
> The reason should be happened here 
> "https://github.com/apache/hadoop/commit/2f500e4635ea4347a55693b1a10a4a4465fe5fac#";,
>  if the _name_ is contained in _allSinks_ but not in _sink_, it will invoke 
> the method of _registerSink_. But if the variable of config is null, it will 
> throw the exception of NullPointerException.
>  
> A suggestion would be checking if the variable of config is null before 
> calling _registerSink._



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to