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

Test(S)WebHdfsFileContextMainOperations failing on branch-2

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.8.0
    • 2.8.0, 3.0.0-alpha1
    • webhdfs
    • None
    • Reviewed

    Description

      After HDFS-8180, TestWebHdfsFileContextMainOperations and TestSWebHdfsFileContextMainOperations are failing with runtime NPEs while instantiating the wrapped WebHDFSFileSystems because getDefaultPort is trying to access a conf that was never provided. In the constructor both both WebHdfs and SWebhdfs the underlying (S)WebHdfsFileSystems are instantiated in the constructor and never have a chance to have their setConf methods called:

        SWebHdfs(URI theUri, Configuration conf)
            throws IOException, URISyntaxException {
          super(theUri, new SWebHdfsFileSystem(), conf, SCHEME, false);
        }r

      The test passes on trunk because HDFS-5321 removed the call to the Configuration instance as part of getDefaultPort. HDFS-5321 was applied to branch-2 but reverted in HDFS-6632, so there's a bit of a difference in how branch-2 versus trunk handles default values (branch-2 pulls them from configs if specified, trunk just returns the hard-coded value from the constants file).

      I've fixed this behave like trunk and return just the hard-coded value, which causes the test to pass.

      There is no WebHdfsFileSystem that takes a Config, which would be another way to fix this.

      Attachments

        1. HDFS-8939-branch-2.003.patch
          2 kB
          Chris Nauroth
        2. HDFS-8939-branch-2.002.patch
          5 kB
          Jakob Homan
        3. HDFS-8939-branch-2.001.patch
          2 kB
          Jakob Homan
        4. HDFS-8939.003.patch
          2 kB
          Chris Nauroth

        Issue Links

          Activity

            People

              cnauroth Chris Nauroth
              jghoman Jakob Homan
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: