You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/11/05 16:20:55 UTC

[GitHub] [flink] tillrohrmann commented on a change in pull request #13911: [FLINK-19909] Shutdown application cluster in attached mode when job cancelled.

tillrohrmann commented on a change in pull request #13911:
URL: https://github.com/apache/flink/pull/13911#discussion_r518178460



##########
File path: flink-clients/src/main/java/org/apache/flink/client/deployment/application/EmbeddedJobClient.java
##########
@@ -126,7 +126,8 @@ public JobID getJobID() {
 					try {
 						return jobResult.toJobExecutionResult(classLoader);
 					} catch (Throwable t) {
-						throw new CompletionException(new Exception("Job " + jobId + " failed", t));
+						throw new CompletionException(
+								UnsuccessfulTerminationException.fromJobResult(jobResult, classLoader));

Review comment:
       Should this become part of the `JobClient.getJobExecutionResult` contract? If yes, then it needs to be documented. Moreover, one could also think about adding a unit test for this behaviour.
   
   Is it guaranteed that the `ApplicationDispatcherBootstrap` will only work with an `EmbeddedJobClient`?

##########
File path: flink-clients/src/main/java/org/apache/flink/client/deployment/application/UnsuccessfulTerminationException.java
##########
@@ -32,11 +32,11 @@
  * application with a given {@link ApplicationStatus}.
  */
 @Internal
-public class ApplicationFailureException extends JobExecutionException {
+public class UnsuccessfulTerminationException extends JobExecutionException {

Review comment:
       Isn't this exception more about an unsuccessful execution or completion than the termination? The termination of the cluster will happen as a result of this exception, right?

##########
File path: flink-clients/src/main/java/org/apache/flink/client/deployment/application/EmbeddedJobClient.java
##########
@@ -126,7 +126,8 @@ public JobID getJobID() {
 					try {
 						return jobResult.toJobExecutionResult(classLoader);
 					} catch (Throwable t) {
-						throw new CompletionException(new Exception("Job " + jobId + " failed", t));
+						throw new CompletionException(
+								ApplicationFailureException.fromJobResult(jobResult, classLoader));

Review comment:
       Is this the actual change which fixes the problem?




----------------------------------------------------------------
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:
users@infra.apache.org