dgrove-oss opened a new issue #84: define preStop hook to enable orderly 
shutdown of Invoker pod
URL: https://github.com/apache/incubator-openwhisk-deploy-kube/issues/84
 
 
   This issue mainly concerns running in a mode where we deploy the Invoker pod 
via Kubernetes, but still use docker to schedule the individual action 
containers.
   
   When an invoker exits in an orderly fashion, it attempts to cleanup its 
actionContainers by invoking removeAllActionContainers from a JVM shutdown hook 
(see 
https://github.com/apache/incubator-openwhisk/blob/0cb847c0906f58fee1166938977708d99261c1c5/core/invoker/src/main/scala/whisk/core/containerpool/docker/DockerContainerFactory.scala#L76).
 
   
   If the invoker crashes (or its pod is terminated by Kubernetes for some 
other reason), this shutdown hook may not be executed or may be executed in a 
way that kills running actions.   We should use the preStop lifecycle hook to 
enable a more orderly shutdown of the invoker and its running actions in the 
case when the invoker is still healthy and it is being descheduled by 
Kubernetes for some other reason. 
   
   Note that if the invoker pod is restarted by Kubernetes on the same worker 
node, one of its first actions will be to invoke removeAllActionContainers from 
the init method of DockerContainerFactory 
https://github.com/apache/incubator-openwhisk/blob/0cb847c0906f58fee1166938977708d99261c1c5/core/invoker/src/main/scala/whisk/core/containerpool/docker/DockerContainerFactory.scala#L73.
  So the leaked resources from a previously crashed invoker should be reclaimed 
when the node is re-used for a future instance of the invoker.   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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

Reply via email to