Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS templates don't react to SIGTERM #273

Open
francisdb opened this issue Nov 29, 2021 · 2 comments
Open

JS templates don't react to SIGTERM #273

francisdb opened this issue Nov 29, 2021 · 2 comments

Comments

@francisdb
Copy link

francisdb commented Nov 29, 2021

The js templates using express are missing SIGTERM handling

Expected Behaviour

A SIGTERM on the container should stop it

Current Behaviour

Nothing happens, the shutdown times out and the container is hard killed

Are you a GitHub Sponsor (Yes/No?)

Check at: https://github.com/sponsors/openfaas

The company I work for is sponsoring (waylay.io)

Which Solution Do You Recommend?

Any of the solutions documented here, I guess the first one is enough
https://expressjs.com/en/advanced/healthcheck-graceful-shutdown.html

Steps to Reproduce (for bugs)

  1. Build an image from one of the node templates
  2. Start a container from the image
  3. Stop the container
  4. You will see it takes a while to actually time out and shut down (it exits with 137 indicating it was killed by kill -9)

Context

This is just an observation and I suspect not handling shutdown properly can interfere with the kubernetes scheduler causing redeploys and scaling to be slower

@alexellis
Copy link
Member

Would you like to have a go at writing a draft PR for this @francisdb?

@alexellis
Copy link
Member

/add label: help wanted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants