[ 
https://issues.apache.org/jira/browse/FLINK-8785?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16527670#comment-16527670
 ] 

ASF GitHub Bot commented on FLINK-8785:
---------------------------------------

Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/6222#discussion_r199170668
  
    --- Diff: 
flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/job/JobSubmitHandlerTest.java
 ---
    @@ -87,4 +89,33 @@ public void testSuccessfulJobSubmission() throws 
Exception {
                handler.handleRequest(new HandlerRequest<>(request, 
EmptyMessageParameters.getInstance()), mockGateway)
                        .get();
        }
    +
    +   @Test
    +   public void testFailedJobSubmission() throws Exception {
    +           final String errorMessage = "test";
    +           DispatcherGateway mockGateway = mock(DispatcherGateway.class);
    +           when(mockGateway.submitJob(any(JobGraph.class), 
any(Time.class))).thenReturn(FutureUtils.completedExceptionally(new 
Exception(errorMessage)));
    +           GatewayRetriever<DispatcherGateway> mockGatewayRetriever = 
mock(GatewayRetriever.class);
    --- End diff --
    
    No need to create a mock. `() -> CompletableFuture.completed(mockGateway)` 
should be good enough.


> JobSubmitHandler does not handle JobSubmissionExceptions
> --------------------------------------------------------
>
>                 Key: FLINK-8785
>                 URL: https://issues.apache.org/jira/browse/FLINK-8785
>             Project: Flink
>          Issue Type: Bug
>          Components: Job-Submission, JobManager, REST
>    Affects Versions: 1.5.0, 1.6.0
>            Reporter: Chesnay Schepler
>            Assignee: Chesnay Schepler
>            Priority: Blocker
>              Labels: flip-6, pull-request-available
>
> If the job submission, i.e. {{DispatcherGateway#submitJob}} fails with a 
> {{JobSubmissionException}} the {{JobSubmissionHandler}} returns "Internal 
> server error" instead of signaling the failed job submission.
> This can for example occur if the transmitted execution graph is faulty, as 
> tested by the \{{JobSubmissionFailsITCase}}.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to