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

Yang Wang commented on FLINK-15843:
-----------------------------------

It seems that the jobmanager and taskmanagers in native integration are already 
running with PID 1. Because we are using {{exec}} in {{kubernetes-entry.sh}}.
{code:java}
wangyang-pc:build-target danrtsey.wy$ kubectl exec -it 
flink-native-k8s-session-1-taskmanager-1-1 bash
bash-4.4$ ps -ef
PID   USER     TIME  COMMAND
    1 flink     0:25 /usr/lib/jvm/java-1.8-openjdk/jre/bin/java -classpath 
/opt/flink-1.11-SNAPSHOT/lib/flink-shaded-hadoop-2-uber-2.8.3-7.0.jar:/opt/flink-1.11-SNAPSHOT/lib/flink-shaded-zookeeper-3.4.10
  308 flink     0:00 bash
  315 flink     0:00 ps -ef
bash-4.4$
{code}

> Gracefully shutdown TaskManagers on Kubernetes
> ----------------------------------------------
>
>                 Key: FLINK-15843
>                 URL: https://issues.apache.org/jira/browse/FLINK-15843
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Deployment / Kubernetes
>    Affects Versions: 1.10.0
>            Reporter: Canbin Zheng
>            Priority: Major
>             Fix For: 1.11.0
>
>
> The current solution of stopping a TaskManager instance when JobManager sends 
> a deletion request is by directly calling 
> {{KubernetesClient.pods().withName().delete}}, thus that instance would be 
> violently killed with a _KILL_ signal and having no chance to clean up, which 
> could cause problems because we expect the process to gracefully terminate 
> when it is no longer needed.
> Refer to the guide of [Termination of Pods|#termination-of-pods], we know 
> that on Kubernetes a _TERM_ signal would be first sent to the main process in 
> each container, and may be followed up with a force _KILL_ signal if the 
> graceful shut-down period has expired; the Unix signal will be sent to the 
> process which has PID 1 ([Docker 
> Kill|https://docs.docker.com/engine/reference/commandline/kill/]), however, 
> the TaskManagerRunner process is spawned by 
> {color:#172b4d}/opt/flink/bin/kubernetes-entry.sh {color}and could never have 
> PID 1, so it would never receive the TERM signal.
>  
>  
>  



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

Reply via email to