Skip to content

Fix health auto-configuration condition timing#381

Open
therepanic wants to merge 1 commit intospring-projects:mainfrom
therepanic:gh-380
Open

Fix health auto-configuration condition timing#381
therepanic wants to merge 1 commit intospring-projects:mainfrom
therepanic:gh-380

Conversation

@therepanic
Copy link
Contributor

@therepanic therepanic commented Mar 3, 2026

Fixes a timing issue. Currently, the logic in
GrpcServerHealthAutoConfiguration.OnHealthIndicatorPathsCondition is incorrect; it can never find the bean, since the condition itself is checked before the beans themselves are created. The tests passed because we were passing the bean itself, not the autoconfiguration with the bean.

Closes: gh-380

Fixes a timing issue. Currently, the logic in
GrpcServerHealthAutoConfiguration.OnHealthIndicatorPathsCondition is
incorrect; it can never find the bean, since the condition itself is
checked before the beans themselves are created. The tests passed
because we were passing the bean itself, not the autoconfiguration with
the bean.

Closes: spring-projectsgh-380

Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
Comment on lines +133 to +138
static class OnHealthDefaultEnablementCondition extends SpringBootCondition implements ConfigurationCondition {

@Override
public ConfigurationCondition.ConfigurationPhase getConfigurationPhase() {
return ConfigurationCondition.ConfigurationPhase.REGISTER_BEAN;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our main mistake was believing it worked the way the tests ran. I described in the commit why it didn't work and that, as far as I'm concerned, this approach works, unless I'm missing any other inputs.

@dsyer dsyer added the status: post-spring-boot-migration Must wait until after #234 is complete label Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: post-spring-boot-migration Must wait until after #234 is complete

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Health checks not exposed anymore

2 participants