Uploaded image for project: 'Apache Tez'
  1. Apache Tez
  2. TEZ-3874

NPE in TezClientUtils when "yarn.resourcemanager.zk-address" is present in Configuration

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 0.9.1
    • 0.9.2
    • None
    • None
    • Reviewed

    Description

      "yarn.resourcemanager.zk-address" is deprecated in favor of "hadoop.zk.address" for Hadoop 2.9+.

      Configuration base class does't auto-translate the deprecation. Only YarnConfiguration applies the translation.

      In TezClientUtils.createFinalConfProtoForApp, a NPE is throw if "yarn.resourcemanager.zk-address" is present in the Configuration.

      for (Entry<String, String> entry : amConf) {
            PlanKeyValuePair.Builder kvp = PlanKeyValuePair.newBuilder();
            kvp.setKey(entry.getKey());
            kvp.setValue(amConf.get(entry.getKey()));
            builder.addConfKeyValues(kvp);
          }
      

      Even though Tez is not specifically looking for the deprecated property, amConf.get(entry.getKey()) will find it during the iteration, if it is in any of the merged xml property resources.

      amConf.get(entry.getKey()) will return null, and kvp.setValue(null) will trigger NPE.

      Suggested solution is to change to:

      YarnConfiguration wrappedConf = new YarnConfiguration(amConf);
      for (Entry<String, String> entry : wrappedConf) {
            PlanKeyValuePair.Builder kvp = PlanKeyValuePair.newBuilder();
            kvp.setKey(entry.getKey());
            kvp.setValue(wrappedConf.get(entry.getKey()));
            builder.addConfKeyValues(kvp);
          }
      

      Attachments

        1. TEZ-3874.1.patch
          4 kB
          Eric Wohlstadter
        2. TEZ-3874.3.patch
          10 kB
          Eric Wohlstadter
        3. TEZ-3874.4.patch
          9 kB
          Eric Wohlstadter
        4. TEZ-3874.5.patch
          10 kB
          Eric Wohlstadter
        5. TEZ-3874.6.patch
          9 kB
          Eric Wohlstadter
        6. TEZ-3874.patch.2
          13 kB
          Eric Wohlstadter

        Issue Links

          Activity

            People

              ewohlstadter Eric Wohlstadter
              ewohlstadter Eric Wohlstadter
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

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