[
https://issues.apache.org/jira/browse/FLINK-15129?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16991601#comment-16991601
]
Aljoscha Krettek commented on FLINK-15129:
------------------------------------------
I noticed one problem, if we return a Future and the last call in the main
method is {{executeAsync()}}, then job submission doesn't work because the
asynchronous threads that are used for that are killed when the main method
exists. Job submission only succeeds when you call {{get()}} on the future
because that waits long enough until the job is submitted.
I'm not saying the we should change the method signature because of this, but
if we keep the method signature the same we have to fix that bug.
> Return JobClient instead of JobClient Future from executeAsync()
> ----------------------------------------------------------------
>
> Key: FLINK-15129
> URL: https://issues.apache.org/jira/browse/FLINK-15129
> Project: Flink
> Issue Type: Sub-task
> Components: API / DataSet, API / DataStream
> Reporter: Aljoscha Krettek
> Priority: Major
>
> Currently, users have to write this when they want to use the {{JobClient}}:
> {code}
> CompletableFuture<JobClient> jobClientFuture = env.executeAsync();
> JobClient jobClient = jobClientFuture.get();
> // or use thenApply/thenCompose etc.
> {code}
> instead we could always return a {{JobClient}} right away and therefore
> remove one step for the user.
> I don't know if it's always the right choice, but currently we always return
> an already completed future that contains the {{JobClient}}. In the future we
> might want to return a future that actually completes at some later point, we
> would not be able to do this if we directly return a {{JobClient}} and would
> have to block in {{executeAsync()}}.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)