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

TestEditLog assumes that FSNamesystem.getFSNamesystem().dir is non-null, even after the FSNameSystem is closed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Cannot Reproduce
    • None
    • None
    • None
    • None

    Description

      In my modified services, I'm setting FSNameSystem.dir to null on close():

              if(dir != null) {
               dir.close();
               dir =  null;
              }
      

      This breaks TestEditLog

      java.lang.NullPointerException
      at org.apache.hadoop.hdfs.server.namenode.FSEditLog.loadFSEdits(FSEditLog.java:620)
      at org.apache.hadoop.hdfs.server.namenode.TestEditLog.testEditLog(TestEditLog.java:148)
      

      There are two possible conclusions here.

      1. Setting dir=null in FSNameSystem.close() is a regression and should be fixed
      2. The test contains some assumptions that are not valid

      I will leave it to others to decide; I will try and fix the code whichever approach is chosen. Personally, I'd go for setting dir=null as it is cleaner, but there is clearly some risk of backward's compatibility problems, at least in test code

      Attachments

        Issue Links

          Activity

            People

              stevel@apache.org Steve Loughran
              stevel@apache.org Steve Loughran
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: