redboxllc / scuttle

A wrapper for applications to help with running Istio Sidecars
MIT License
116 stars 25 forks source link

limiting scuttle shutdown to SIGINT signals #45

Closed linjmeyer closed 3 years ago

linjmeyer commented 3 years ago

Fixes #44

Scuttle listens for OS signals (SIGINT, SIGURG, etc.) and passes them to the child process. This is needed to ensure signals sent by the node/k8s/container runtime make it to the underlying app running in the container. If the child process has not been started yet (typically if Envoy is not up and healthy yet) then any signal will result in Scuttle exiting immediately. That functionality is from the original fork so I'm not entirely sure why it was done that way.

Kubernetes shuts down containers by sending a SIGINT, then later a SIGKILL. It's not possible to handle a SIGKILL, so I think prior to the child process starting we only need to listen to SIGINT and shutdown then.

Changes:

jvasallo commented 3 years ago

Makes sense, and looks good to me. Merging in. Agreed, not sure how to test our scripts but good we share them out in case others need them. :D