zuston commented on a change in pull request #18220:
URL: https://github.com/apache/flink/pull/18220#discussion_r778051063



##########
File path: 
flink-yarn/src/main/java/org/apache/flink/yarn/YarnClusterDescriptor.java
##########
@@ -1195,53 +1189,72 @@ private ApplicationReport startAppMaster(
         yarnClient.submitApplication(appContext);
 
         LOG.info("Waiting for the cluster to be allocated");
+
+        try {
+            waitTillTargetState(
+                    yarnClient, appId, YarnApplicationState.ACCEPTED, 
YarnApplicationState.RUNNING);
+        } catch (IOException e) {
+            throw new YarnDeploymentException("Failed to deploy the cluster.", 
e);
+        }
+
+        // since deployment was successful, remove the hook
+        ShutdownHookUtil.removeShutdownHook(deploymentFailureHook, 
getClass().getSimpleName(), LOG);
+
+        return ApplicationReportProviderImpl.of(yarnClient, applicationId);

Review comment:
       Maybe the `yarnClient` should be used directly in the method of 
`waitTillTargetState`, not as the param of method.
   Right?




-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to