TisonKun commented on a change in pull request #10311: [FLINK-14762][client]
Enrich JobClient API
URL: https://github.com/apache/flink/pull/10311#discussion_r351161355
##########
File path: flink-clients/src/main/java/org/apache/flink/client/ClientUtils.java
##########
@@ -105,13 +103,9 @@ public static JobExecutionResult submitJob(
JobGraph jobGraph) throws ProgramInvocationException {
checkNotNull(client);
checkNotNull(jobGraph);
- try {
- return client
- .submitJob(jobGraph)
- .thenApply(JobSubmissionResult::getJobID)
- .thenApply(DetachedJobExecutionResult::new)
- .get();
- } catch (InterruptedException | ExecutionException e) {
+ try (JobClient jobClient = client.submitJob(jobGraph).get()){
Review comment:
We don't have the ownership of `ClusterClient` here and if you take a look
at its callers you will find that either the caller close `ClusterClient`
immediately properly or the caller close a shared `ClusterClient` later when it
is end of life.
----------------------------------------------------------------
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