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

BPServiceActor thread name is not correctly set

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.9.0, 3.0.0-alpha4, 2.8.2
    • hdfs
    • None
    • Reviewed

    Description

      When running unit tests (e.g. TestJMXGet), we often get this following exception, although the tests still passed:

      WARN  datanode.DataNode (BPOfferService.java:getBlockPoolId(192)) - Block pool ID needed, but service not yet registered with NN
      java.lang.Exception: trace 
      at org.apache.hadoop.hdfs.server.datanode.BPOfferService.getBlockPoolId(BPOfferService.java:192) at org.apache.hadoop.hdfs.server.datanode.BPServiceActor.formatThreadName(BPServiceActor.java:556) at org.apache.hadoop.hdfs.server.datanode.BPServiceActor.start(BPServiceActor.java:544) at 
      ...
      

      It seems that, although this does not affect normal operations, this is causing the thread name of BPServiceActor not correctly set as desired. More specifically,:

       bpThread = new Thread(this, formatThreadName("heartbeating", nnAddr));
       bpThread.setDaemon(true); // needed for JUnit testing
       bpThread.start();
      

      The first line tries to call formatThreadName to get format a thread name, and formatThreadName is reading the value of BPOfferService#bpNSInfo. However this value is set only after the thread started (the third line above). So we get exception in the first line for reading non-existing value.

      Attachments

        1. HDFS-11932.001.patch
          2 kB
          Chen Liang
        2. HDFS-11932.002.patch
          2 kB
          Chen Liang

        Activity

          People

            vagarychen Chen Liang
            vagarychen Chen Liang
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: