Open niodice opened 1 year ago
@niodice using the SIGTERM
(as opposed to calling close()
on the server) is going to bypass a lot of the graceful shutdown mechanics, IIRC.
The most straightforward thing to do, likely is to handle the interrupt using c.t.util.HandleSignal
and then call close()
.
See: https://twitter.github.io/finatra/user-guide/app/index.html#an-example-of-handling-signals (note a TwitterServer is an App, so you can follow the example similarly somewhere in your Server definition)
You likely also want to mess with the grace period in the server as well if necessary to allow for more time for closing resources if necessary. Hope that helps.
Background Context
I'm working in a hosting environment that at a high level works like this:
/health
endpoint, exposed via admin port, to identify if hosts are healthy and routable.unlealthy
and traffic will not be routed to that instance.SIGTERM
is sent to the service to trigger a shutdown.Observed behavior
SIGTERM
, it appears that a few things happen:Pain points
healthy
Desired behavior
15 seconds
)