kl0u commented on a change in pull request #9972: [FLINK-14496][client] Exclude
detach flag from ClusterClient
URL: https://github.com/apache/flink/pull/9972#discussion_r340515896
##########
File path:
flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/local/ProgramDeployer.java
##########
@@ -159,22 +158,15 @@ public JobExecutionResult fetchExecutionResult() {
result.setClusterInformation(clusterClient.getClusterId(), webInterfaceUrl);
// submit job (and get result)
if (awaitJobResult) {
- clusterClient.setDetached(false);
final JobExecutionResult jobResult =
clusterClient
- .submitJob(jobGraph,
context.getClassLoader())
- .getJobExecutionResult(); // throws
exception if job fails
+ .submitJob(jobGraph)
+
.thenApply(JobSubmissionResult::getJobID)
+
.thenCompose(clusterClient::requestJobResult)
+ .get()
+
.toJobExecutionResult(context.getClassLoader()); // throws exception if job
fails
executionResultBucket.add(jobResult);
} else {
- clusterClient.setDetached(true);
- clusterClient.submitJob(jobGraph,
context.getClassLoader());
- }
- } finally {
- try {
- if (clusterClient != null) {
- clusterClient.close();
- }
- } catch (Exception e) {
- // ignore
+ clusterClient.submitJob(jobGraph).get();
Review comment:
Wrap it in a `DetachedJobExecutionResult` for backwards compatibility. It is
a bit weird, I agree, but this is the previous behaviour from what I understand.
----------------------------------------------------------------
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