[ https://issues.apache.org/jira/browse/FLINK-8299?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16322360#comment-16322360 ]
ASF GitHub Bot commented on FLINK-8299: --------------------------------------- Github user GJL commented on a diff in the pull request: https://github.com/apache/flink/pull/5207#discussion_r160980332 --- Diff: flink-clients/src/main/java/org/apache/flink/client/program/rest/RestClusterClient.java --- @@ -104,11 +122,26 @@ protected JobSubmissionResult submitJob(JobGraph jobGraph, ClassLoader classLoad } catch (JobSubmissionException e) { throw new ProgramInvocationException(e); } - // don't return just a JobSubmissionResult here, the signature is lying - // The CliFrontend expects this to be a JobExecutionResult - // TOOD: do not exit this method until job is finished - return new JobExecutionResult(jobGraph.getJobID(), 1, Collections.emptyMap()); + final JobExecutionResult jobExecutionResult = waitForJobExecutionResult(jobGraph.getJobID()); + + if (jobExecutionResult.getSerializedThrowable().isPresent()) { + final SerializedThrowable serializedThrowable = jobExecutionResult.getSerializedThrowable().get(); + final Throwable throwable = serializedThrowable.deserializeError(classLoader); + throw new ProgramInvocationException(throwable); + } + + try { + // don't return just a JobSubmissionResult here, the signature is lying + // The CliFrontend expects this to be a JobExecutionResult + this.lastJobExecutionResult = new SerializedJobExecutionResult( + jobExecutionResult.getJobId(), + jobExecutionResult.getNetRuntime(), + jobExecutionResult.getAccumulatorResults()).toJobExecutionResult(classLoader); --- End diff -- I need the `JobExecutionResult` here; not only accumulators. > Retrieve ExecutionResult by REST polling > ---------------------------------------- > > Key: FLINK-8299 > URL: https://issues.apache.org/jira/browse/FLINK-8299 > Project: Flink > Issue Type: Sub-task > Components: REST > Affects Versions: 1.5.0 > Reporter: Gary Yao > Assignee: Gary Yao > Priority: Blocker > Labels: flip-6 > Fix For: 1.5.0 > > > Retrieve the {{ExecutionResult}} from a finished Flink job via the > {{RestClusterClient}}. -- This message was sent by Atlassian JIRA (v6.4.14#64029)