wangyang0918 commented on a change in pull request #10010:
[FLINK-10435][yarn]Client sporadically hangs after Ctrl + C
URL: https://github.com/apache/flink/pull/10010#discussion_r339440907
##########
File path:
flink-yarn/src/main/java/org/apache/flink/yarn/YarnClusterDescriptor.java
##########
@@ -1526,16 +1525,22 @@ public YarnDeploymentException(String message,
Throwable cause) {
private final YarnClientApplication yarnApplication;
private final Path yarnFilesDir;
- DeploymentFailureHook(YarnClient yarnClient,
YarnClientApplication yarnApplication, Path yarnFilesDir) {
- this.yarnClient =
Preconditions.checkNotNull(yarnClient);
+ DeploymentFailureHook(YarnClientApplication yarnApplication,
Path yarnFilesDir) {
this.yarnApplication =
Preconditions.checkNotNull(yarnApplication);
this.yarnFilesDir =
Preconditions.checkNotNull(yarnFilesDir);
+
+ // A new yarn client need to be created in shutdown
hook in order to avoid
+ // the yarn client has been closed by
YarnClusterDescriptor.
+ this.yarnClient = YarnClient.createYarnClient();
+ this.yarnClient.init(yarnConfiguration);
}
@Override
public void run() {
LOG.info("Cancelling deployment from Deployment Failure
Hook");
+ this.yarnClient.start();
Review comment:
Have updated.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services