Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-16838

Fix NPE in testAddRplicaProcessorForAddingReplicaInMap

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.4.0
    • 3.4.0
    • test
    • Reviewed

    Description

      There is a NPE in org.apache.hadoop.hdfs.server.datanode.fsdataset.impl.TestFsVolumeList#testAddRplicaProcessorForAddingReplicaInMap if we run this UT individually. And the related bug as bellow:

       

      public void testAddRplicaProcessorForAddingReplicaInMap() throws Exception {
        // BUG here
        BlockPoolSlice.reInitializeAddReplicaThreadPool();
        Configuration cnf = new Configuration();
        int poolSize = 5; 
        ...
      }

       

      addReplicaThreadPool may not have been initialized and is null, if we run testAddRplicaProcessorForAddingReplicaInMap unit test as an individual unit test.

      @VisibleForTesting
      public static void reInitializeAddReplicaThreadPool() {
        addReplicaThreadPool.shutdown();
        addReplicaThreadPool = null;
      }

      Attachments

        Issue Links

          Activity

            People

              xuzq_zander ZanderXu
              xuzq_zander ZanderXu
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: