[ https://issues.apache.org/jira/browse/TEZ-3874?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16284005#comment-16284005 ]
Jason Lowe commented on TEZ-3874: --------------------------------- IIUC a YARN client should not need to know the RM's ZK address setting. That setting is to inform the ResourceManager where it can find the ZooKeeper instance for handling failovers and electing new active instances. Even if a client did try to access that value, they should be accessing it with the new key value. The client code would be accessing the value most likely via YarnConfiguration.RM_ZK_ADDRESS which will trigger the YarnConfiguration class to load and invoke the static code block that adds the deprecated keys. Therefore a client looking up the key directly, instead of trying to iterate values, will be automatically remapped to the new key. So bottom line is I think skipping null values is all we need to do here. > NPE in TezClientUtils when "yarn.resourcemanager.zk-address" is present in > Configuration > ---------------------------------------------------------------------------------------- > > Key: TEZ-3874 > URL: https://issues.apache.org/jira/browse/TEZ-3874 > Project: Apache Tez > Issue Type: Bug > Affects Versions: 0.9.1 > Reporter: Eric Wohlstadter > Priority: Blocker > Fix For: 0.9.1 > > Attachments: TEZ-3874.1.patch > > Original Estimate: 48h > Remaining Estimate: 48h > > "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. > {code} > for (Entry<String, String> entry : amConf) { > PlanKeyValuePair.Builder kvp = PlanKeyValuePair.newBuilder(); > kvp.setKey(entry.getKey()); > kvp.setValue(amConf.get(entry.getKey())); > builder.addConfKeyValues(kvp); > } > {code} > 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: > {code} > 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); > } > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)