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

Yang Wang commented on FLINK-15790:
-----------------------------------

[~trohrmann] I prefer to make all potentially blocking operations in 
{{FlinkKubeClient}} asynchronous.

The methods {{createTaskManagerPod, stopPod}} will be certainly updated to 
asynchronous.

Do you think all other resource operations {{createConfigMap, 
createInternalService, createRestService, createFlinkMasterDeployment, 
stopAndCleanupCluster}} should also be synchronous? This methods are executed 
on client side or in the init of {{KubernetesResourceManager}}.

BTW, I do not think we also need to make all the get methods 
{{getInternalService, getRestService, getRestEndpoint, getPodsWithLabels}}. 
When we call these methods, we are always expecting the result immediately.

> Make FlinkKubeClient and its implementations asynchronous
> ---------------------------------------------------------
>
>                 Key: FLINK-15790
>                 URL: https://issues.apache.org/jira/browse/FLINK-15790
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Deployment / Kubernetes
>    Affects Versions: 1.10.0
>            Reporter: Till Rohrmann
>            Priority: Critical
>             Fix For: 1.11.0, 1.10.1
>
>
> The {{FlinkKubeClient}} interface offers several methods which are 
> synchronous (e.g. {{FlinkKubeClient.createTaskManagerPod}}, 
> {{FlinkKubeClient.stopPod}}, {{FlinkKubeClient.getPodsWithLabels}}, etc). The 
> problem is that these methods are directly used by the 
> {{KubernetesResourceManager}} which calls them from the main thread. Since 
> these methods perform I/O operations (sending and receiving network packages) 
> they can potentially block the execution and hence should not happen from the 
> {{RpcEndpoint's}} main thread.
> I propose to make all potentially blocking operations on the 
> {{FlinkKubeClient}} asynchronous so that the {{KubernetesResourceManager}} 
> does not risk to block the main thread. Alternatively, we could also 
> introduce a {{FlinkKubeClientAsync}} which offers asynchronous operations.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to