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
HealthContributor beans managed by a CompositeHealthContributor are recreated on each call #29640
Comments
This does indeed look like an oversight. With a single contributor, the result is returned directly and is treated as a singleton. With the composite we're calling I think we should change the composite to call the value adapter early. We might need to be a little careful about back compatibility. |
This has been superseded by #31676, but it seems to have missed to close it. |
Spring Boot (tested with 2.6.3) aggregates multiple instances of the same health indicator
This lifecycle inconsistency seems unintended to me.
Demo: https://github.com/schuch/actuator-test
Fire up the application and call http://localhost:8080/actuator/health multiple times, then view the log.
This will be logged for every request:
This is logged only once at startup:
Sample Log:
This behavior makes it impossible to keep state in health indicators after initialization.
E.g.
SolrHealthIndicator
has a heuristic approach to detect the suitable status check method.The recreation of the health indicator makes it pointless to store the check method.
Also unnecessary 404 errors are raised in the solr log for every health check.
The text was updated successfully, but these errors were encountered: