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

Run CompositeHealthIndicator in parallel #15770

Closed
wants to merge 4 commits into from
Closed

Run CompositeHealthIndicator in parallel #15770

wants to merge 4 commits into from

Conversation

RikEnde
Copy link

@RikEnde RikEnde commented Jan 23, 2019

See #2652

Problem:
The CompositeHealthIndicator polls all the HealthIndicators in the registry sequentially. I have a number of HealtIndicator components that poll remote systems and report on latency and status, and the latency really adds up, especially if there are time-outs involved.

Solution:
This PR polls the HealthIndicators concurrently. It preserves the original ordering, and outputs the same as the old implementation, except the runtime is proportional to that of the slowest component, rather than the aggregate of all components. The impact of this change should be very small, unless someone's code absolutely depends on HealthIndicators being polled sequentially but in unknown order.

@pivotal-issuemaster
Copy link

@RikEnde Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-issuemaster
Copy link

@RikEnde Thank you for signing the Contributor License Agreement!

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 23, 2019
@RikEnde RikEnde changed the title 2.1.x fix for issue 2652 2.1.x fix for issue 2652: run CompositeHealthIndicator in parallel Jan 23, 2019
@philwebb philwebb added the for: team-attention An issue we'd like other members of the team to review label Jan 24, 2019
@snicoll snicoll changed the title 2.1.x fix for issue 2652: run CompositeHealthIndicator in parallel Run CompositeHealthIndicator in parallel Jan 24, 2019
@RikEnde
Copy link
Author

RikEnde commented Jan 25, 2019

I'm pretty sure my commit didn't break the build or cause that timeout...

@snicoll
Copy link
Member

snicoll commented Jan 31, 2019

@RikEnde you are right, your change did not break the build.

We have a task execution infrastructure now in place and we'd rather use that if it's available rather than using parallelStream. Thanks for the PR, in any case.

@snicoll snicoll closed this Jan 31, 2019
@snicoll snicoll added status: declined A suggestion or change that we don't feel we should currently apply and removed for: team-attention An issue we'd like other members of the team to review status: waiting-for-triage An issue we've not yet triaged labels Jan 31, 2019
@RikEnde
Copy link
Author

RikEnde commented Jan 31, 2019

Fair enough. Are you referring to the ConcurrentTaskExecutor, or something new?

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.

5 participants