-
Notifications
You must be signed in to change notification settings - Fork 41k
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
Shut down management server only once main server is shut down #41002
Comments
This isn't really related to the lifecycle phases as they're not involved in closing the management context which is done by Unfortunately, I think it will be quite difficult to allow the ordering to be changed as we'd have to move away from using the |
I've opened spring-projects/spring-framework#33058 to see if Framework could make the application context's close state accessible to us. |
I think one alternative solution to this could be using Prometheus RSocket Proxy (but you need to deploy an extra component in your infrastructure). In the use-case above, if Prometheus does not scrape while the long-running processes is running, or one/some of the scrapes fail or Prometheus is not scraping enough, I think you can be in a similar situation even if the management endpoint is still able to accept traffic. In case of the Prometheus RSocket Proxy, both the Proxy can scrape the app and the app can also send data to the Proxy (that is scraped by Prometheus later). So if the ordering is right, your app can send the latest data to the Proxy right before the process stops (after your long-running process finished its job). |
Framework 6.2 now provides an |
|
I try to describe our use case and the problem we have:
We're using Prometheus to scrape the metrics.
We set
server.port=8080
andmanagement.server.port=9090
(hence a second http server is used).Stopping the application gracefully can take longer since the app has long-running processes that we're waiting on.
While waiting on these, we want the default server to be shutting down, but the management server to be up, so we can still scrape the metrics.
Currently, the management server is started after and stopped before the default server, preventing this. The phases/order for the servers cannot changed in any way.
I totally acknowledge that the current order is the way it is, to not serve the health endpoints before the default server is up. And as discussed in #31714 that the phases must be well configured and are easy to get wrong. But I'd love to have some kind of possibility to change the order (e.g. by subclassing).
The text was updated successfully, but these errors were encountered: