-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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
Introduce strategy for running HealthIndicators #5066
Introduce strategy for running HealthIndicators #5066
Conversation
3d4b2c5
to
40a2aa0
Compare
I've reworked/simplified PR to have minimal impact and preserve backwards compatibility which was broken for some components (namely This should be a better starting point for an enhancement request. |
private boolean runInParallel = false; | ||
|
||
/** | ||
* Number of threads to use for parallel invocation of health indicators. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May want to explicitly document here that this should be greater than one if set.
Thanks for the PR! We've seen the need in a few places in Boot to run things in the background and we're discussing the idea of adding a general |
Would applying the approach described in #5619 (comment) help in speeding up the process of adding this feature?
|
40a2aa0
to
d5809a8
Compare
I've simplified the PR even more so it does not introduce any new configuration properties. Parallel invocation of health indicators is now enabled by simply registering This makes the PR not dependent of #5082. |
We're going to need to rework actuator support in 2.0 for reactive programming. I'll put this on hold until that work has been completed. |
b5e32ef
to
b135b51
Compare
b135b51
to
cc7fb72
Compare
@vpavic the registry is now merged and the reactor health indicator already uses Project reactor to dispatch the processing of health indicators if necessary. I think it would be quite interesting to have something for the servlet use case but I am not sure where to put it exactly. As you've submitted this PR, I'd love to get your feedback on this. |
Spring Boot 2.1 has now an |
This PR is quite old and would need a significant rewrite considering that we have a @vpavic thanks for the PR, in any case! |
@snicoll Can you clarify in which direction exactly did you want to see it rewritten? Having async execution as default? |
I don't know yet but using |
This PR introduces strategy for running
HealthIndicator
instances.The default implementations keep the current invocation pattern, which is sequential, and allows parallel invocation to be configured via properties. This addresses scenarios with many
HealthIndicator
s and/or resource demandingHealthIndicator
instances (see #2652).I'll add the documentation updates later, if this enhancement is accepted.
I've signed the CLA.