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

HealthContributor beans managed by a CompositeHealthContributor are recreated on each call #31676

Closed
wants to merge 1 commit into from

Conversation

terminux
Copy link
Contributor

@terminux terminux commented Jul 12, 2022

During the construction of the NamedContributorsMapAdapter, each value adapter is called only once.

Closes gh-29640

@terminux terminux changed the base branch from main to 2.6.x July 12, 2022 01:47
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 12, 2022
@wilkinsona
Copy link
Member

@philwebb could you take a look at this one please? You mentioned on the issue that we'd need to be careful about backwards compatibility.

philwebb pushed a commit that referenced this pull request Jul 26, 2022
Update `NamedContributorsMapAdapter` so that the adapter function is
called only once per entry. Prior to this commit, the adapter was called
dynamically which made `CompositeHealthContributor` behave differently
from a regular `HealthContributor`.

See gh-31676
philwebb added a commit that referenced this pull request Jul 26, 2022
@philwebb philwebb closed this in 1e886bd Jul 26, 2022
@philwebb philwebb reopened this Jul 26, 2022
@philwebb philwebb added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 26, 2022
@philwebb philwebb added this to the 2.6.11 milestone Jul 26, 2022
@philwebb
Copy link
Member

I think my original concern was that existing users might be relying on the dynamic adapter code. I've pushed the PR with a polish commit, but I think I'll change it a little more so that the adaption is done on first access rather than during construction.

@philwebb
Copy link
Member

Actually, on second thoughts, I think things are fine. We previously called the valueAdapter during construction to validate the result.

Thanks for the PR @terminux

@philwebb philwebb closed this Jul 26, 2022
philwebb added a commit that referenced this pull request Jul 27, 2022
Update `NamedContributorsMapAdapter` to collect items to a
`LinkedHashMap` rather than a `HashMap`.

See gh-31676
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HealthContributor beans managed by a CompositeHealthContributor are recreated on each call
4 participants