-
Notifications
You must be signed in to change notification settings - Fork 41.2k
When running on a separate port, Actuator health endpoint may report healthy before the main port is listening #15378
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
Comments
I think we should consider reworking the logic that launches the management server so that it only happens once the main web server has been initialised. I've prototyped such a change in this branch. From what I can tell, it seems to work nicely and was a straightforward change. That makes me think I may have missed something… One thing that the proposed change does lose is the warning when you set a separate management port but deploy your app as a war to a servlet container. There won't be a failure, but Flagging for team attention in case I have missed something and to get the team's opinion on the importance of the warning. |
Is it possible to keep the warning if |
Yeah, that's possible. We could also listen for another event ( |
When configuring an application to use a dedicated port for the management endpoints:
management.server.port: 8081
the health endpoint reports "UP" without waiting for the main application port to be exposed. This does not happen when both actuator and application are using the same port, which causes an undesired asymmetry.
This problem can be reproduced easily by having a SmartLifeCycle bean that will be registered to the main application context as is the case when using Spring Cloud Stream with a binding configured (i.e. with Kafka), the InputBindingLifecycle/OutputBindingLifecycle in default configuration will retry for a number of times before failing. During this period, the application has been reported as healthy.
Shouldn't there be an out of the box mechanism for the actuator health endpoint to be aware that the main application port is not yet exposed?
Reproduced with
spring boot version: 2.0.3
.The text was updated successfully, but these errors were encountered: