You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working in a hosting environment that at a high level works like this:
Load balancer monitors /health endpoint, exposed via admin port, to identify if hosts are healthy and routable.
If the health check fails for an instance some number of times in a row, the service is marked as unlealthy and traffic will not be routed to that instance.
During deployments or instance replacements, a SIGTERM is sent to the service to trigger a shutdown.
Observed behavior
When the service receives a SIGTERM, it appears that a few things happen:
Both the admin server and application server handle the signal and shutdown immediately
This is problematic because there is a period of time where:
The admin server has shut down and won't report healthy
The application server has shut down and won't accept any requests
The load balancer is still routing traffic to this instance because there needs to be > 1 occurrence of a failed health check before the instance is taken out of rotation. These requests fail. It is not always safe to retry these requests because they may not be idempotent.
Desired behavior
Is there a way to have fine control over the shutdown sequence? Ideally, I would:
Shut down admin server (or tell admin server to report a non 200 status code) and keep the application server up for a configurable amount of time, say 15 seconds)
After some period of time, shutdown the application server and then gracefully terminate the program.
The text was updated successfully, but these errors were encountered:
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
)The text was updated successfully, but these errors were encountered: