Skip to content
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

Conversation

vpavic
Copy link
Contributor

@vpavic vpavic commented Feb 1, 2016

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 HealthIndicators and/or resource demanding HealthIndicator instances (see #2652).

I'll add the documentation updates later, if this enhancement is accepted.

I've signed the CLA.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 1, 2016
@philwebb philwebb added for: team-attention An issue we'd like other members of the team to review and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 2, 2016
@vpavic vpavic force-pushed the introduce-health-indicator-runner branch from 3d4b2c5 to 40a2aa0 Compare February 2, 2016 23:26
@vpavic
Copy link
Contributor Author

vpavic commented Feb 2, 2016

I've reworked/simplified PR to have minimal impact and preserve backwards compatibility which was broken for some components (namely CompositeHealthIndicator and HealthEndpoint) in the initial version.

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.
Copy link
Member

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.

@philwebb
Copy link
Member

philwebb commented Feb 3, 2016

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 TaskExecutor. We're going to try and address that before supporting parallel HealthIndicator invocation since it will likely have an impact.

@wilkinsona wilkinsona removed the for: team-attention An issue we'd like other members of the team to review label Feb 10, 2016
@vpavic
Copy link
Contributor Author

vpavic commented Jun 14, 2016

Would applying the approach described in #5619 (comment) help in speeding up the process of adding this feature?

If the user has defined an AsyncTaskExecutor that is primary, maybe we should automatically enable that feature.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 17, 2016
@vpavic vpavic force-pushed the introduce-health-indicator-runner branch from 40a2aa0 to d5809a8 Compare September 4, 2016 16:05
@vpavic
Copy link
Contributor Author

vpavic commented Sep 4, 2016

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 HealthIndicatorRunner @Bean. Implementation based on AsyncTaskExecutor is provided in AsynchronousHealthIndicatorRunner.

This makes the PR not dependent of #5082.

@philwebb philwebb added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 6, 2016
@philwebb philwebb added the status: on-hold We can't start working on this issue yet label Jan 11, 2017
@philwebb
Copy link
Member

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.

@vpavic vpavic force-pushed the introduce-health-indicator-runner branch 2 times, most recently from b5e32ef to b135b51 Compare January 18, 2017 21:23
@philwebb philwebb added this to the Icebox milestone Mar 22, 2018
@bclozel bclozel removed the status: on-hold We can't start working on this issue yet label Mar 22, 2018
@vpavic vpavic force-pushed the introduce-health-indicator-runner branch from b135b51 to cc7fb72 Compare May 4, 2018 08:48
@snicoll
Copy link
Member

snicoll commented May 18, 2018

@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.

@snicoll
Copy link
Member

snicoll commented Dec 3, 2018

Spring Boot 2.1 has now an applicationTaskExecutor so perhaps we could rework this proposal based on that?

@snicoll snicoll added the for: team-attention An issue we'd like other members of the team to review label Dec 3, 2018
@snicoll
Copy link
Member

snicoll commented Dec 5, 2018

This PR is quite old and would need a significant rewrite considering that we have a TaskExecutor infrastructure now. I am going to close this one as the original issue is still open.

@vpavic thanks for the PR, in any case!

@snicoll snicoll closed this Dec 5, 2018
@snicoll snicoll removed for: team-attention An issue we'd like other members of the team to review type: enhancement A general enhancement labels Dec 5, 2018
@snicoll snicoll removed this from the General Backlog milestone Dec 5, 2018
@snicoll snicoll added the status: declined A suggestion or change that we don't feel we should currently apply label Dec 5, 2018
@vpavic
Copy link
Contributor Author

vpavic commented Dec 5, 2018

@snicoll Can you clarify in which direction exactly did you want to see it rewritten? Having async execution as default?

@snicoll
Copy link
Member

snicoll commented Dec 5, 2018

I don't know yet but using applicationTaskExecutor for async execution is something I'd do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined A suggestion or change that we don't feel we should currently apply
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants