maheshrajus commented on code in PR #520:
URL: https://github.com/apache/tez/pull/520#discussion_r3664189755


##########
tez-api/src/main/java/org/apache/tez/client/TezClientUtils.java:
##########
@@ -961,7 +961,26 @@ static DAGClientAMProtocolBlockingPB 
getAMProxy(FrameworkClient frameworkClient,
       throw new TezException(e);
     }
 
-    return getAMProxy(conf, appReport.getHost(), appReport.getRpcPort(),
+    // YARN-808 gap: when the AM container is first allocated YARN briefly
+    // reports state=RUNNING before the AM has registered with the RM or bound
+    // its RPC listener. During that window the ApplicationReport contains
+    // sentinel values that must not be passed to
+    // NetUtils.createSocketAddrForHost() (which would throw
+    // IllegalArgumentException: port out of range) or to RPC.getProxy():
+    //   host == null / "N/A" : RM has not received registerApplicationMaster()
+    //   rpcPort == 0         : protobuf wire default
+    //   rpcPort == -1        : container up but RPC listener not yet bound
+    // Returning null lets callers (waitForProxy, sendAMHeartbeat) back off
+    // and retry rather than crash.
+    String amHost = appReport.getHost();
+    int amRpcPort = appReport.getRpcPort();
+    if (amHost == null || amHost.equals("N/A") || amRpcPort <= 0) {

Review Comment:
   Fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to