gnomad-browser icon indicating copy to clipboard operation
gnomad-browser copied to clipboard

Graceful shutdown

Open nawatts opened this issue 4 years ago • 1 comments

API containers take a long time to terminate. I suspect it's because the API does not handle SIGTERM/SIGINT and thus ends up getting killed after some timeout.

https://github.com/BretFisher/node-docker-good-defaults#production-minded-features

nawatts avatar Feb 25 '21 20:02 nawatts

@nawatts We've been looking at similar problems over in Clingen for a bit. If the api servers are a kubernetes workload, you can set a terminationGracePeriodSeconds in the pod spec to configure how long to allow the containers to stop (default is 30s).

If catching SIG{TERM,INT} proves difficult, you can also specify a preStop hook, which can be an HTTP endpoint in the app that kubernetes will call prior to sending a signal: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks

sjahl avatar Jul 13 '21 14:07 sjahl