[
https://issues.apache.org/jira/browse/HADOOP-17468?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
ASF GitHub Bot updated HADOOP-17468:
------------------------------------
Labels: pull-request-available (was: )
> 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
> Priority: Major
> Labels: pull-request-available
> Time Spent: 10m
> 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.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]