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:
[email protected]


Reply via email to