Siyao Meng created YARN-12038:
---------------------------------

             Summary: YARN service AM forces java.net.preferIPv4Stack=true
                 Key: YARN-12038
                 URL: https://issues.apache.org/jira/browse/YARN-12038
             Project: Hadoop YARN
          Issue Type: Bug
          Components: yarn-native-services
            Reporter: Siyao Meng
            Assignee: Siyao Meng


{{ServiceClient}} builds every service AM command line with {{forceIPv4()}} 
([ServiceClient.java:1227|https://github.com/apache/hadoop/blob/1097744bc490b65cad5ab2fbeafff35687971357/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/ServiceClient.java#L1227]):
{code:java}
public JavaCommandLineBuilder forceIPv4() {
  sysprop("java.net.preferIPv4Stack", "true");
{code}
[JavaCommandLineBuilder.java:80|https://github.com/apache/hadoop/blob/1097744bc490b65cad5ab2fbeafff35687971357/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/containerlaunch/JavaCommandLineBuilder.java#L80]

This setting does not follow {{HADOOP_OPTS}} and is not documented. On an 
IPv6-only cluster the service AM cannot open IPv6 sockets to the 
ResourceManager, ZooKeeper or HDFS. HADOOP-20026 covers the same problem for 
MapReduce task JVMs.

Workaround: {{yarn.service.am.java.opts=-Djava.net.preferIPv4Stack=false}}. 
Those options come after the forced flag, the JVM uses the last {{-D}}, and 
{{validateJvmOpts}} accepts the value.

Verified by reading the code and checking that the later {{-D}} wins. The AM 
failure itself was not reproduced.

*Proposed fix:* remove {{forceIPv4()}} from {{buildCommandLine}} so the AM uses 
the JVM default, as the MR AM already does. This changes a default, so add a 
release note.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to