Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-17468

NullPointerException from register in MetricsSystemImpl

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      This is an error from Ozone's unit test case HDDS-4688. The error is as follows:

       

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

      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.

      Attachments

        Issue Links

          Activity

            People

              Symious Janus Chow
              Symious Janus Chow
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h