Open dcoder2099 opened 1 year ago
Hey, we are currently doing the exact same thing (graceful shutdown of express app in k8s) so I don't know if it's perfect but I can share what I figured out :
shutDownDelay
in the options (your shutdown handler gets called after that delay),http-terminator
as well, because without it your express server is likely to hang due to persistent requests (websockets, keep-alive...),We were already using lightship, but for simple workers picking up jobs (no incoming requests), so any corrections are welcome :)
I have an express app that is going to be deployed into a k8s stack and was investigating the use of lightship for readiness checks.
In the lightship readme is the recommendation "Add a delay before stop handling incoming requests"…
Instead of this, would it be reasonable to use http-terminator inside a lightship shutdown handler? Or is that redundant?