Janus Chow created HADOOP-17468:
-----------------------------------
Summary: 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
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]