Skip to content

Run CompositeHealthIndicator in parallel - #15770

Closed
RikEnde wants to merge 4 commits into
spring-projects:2.1.xfrom
RikEnde:2.1.x
Closed

Run CompositeHealthIndicator in parallel#15770
RikEnde wants to merge 4 commits into
spring-projects:2.1.xfrom
RikEnde:2.1.x

Conversation

@RikEnde

@RikEnde RikEnde commented Jan 23, 2019

Copy link
Copy Markdown

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
Copy Markdown

@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
Copy Markdown

@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

RikEnde commented Jan 25, 2019

Copy link
Copy Markdown
Author

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

@snicoll

snicoll commented Jan 31, 2019

Copy link
Copy Markdown
Member

@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

RikEnde commented Jan 31, 2019

Copy link
Copy Markdown
Author

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