spring-projects / spring-projects/spring-boot
Spring gRPC health check triggers MailHealthIndicator eagerly
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 81.5k
- Forks
- 42.7k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 65
Description
Problem statement: Spring Boot 4.1.0 / spring-grpc 1.1.0 — combining spring-grpc with Spring Mail causes the SMTP server to be probed every 5 seconds unexpectedly.
The gRPC health scheduler unconditionally invokes all HealthIndicator/HealthContributor beans registered in the global HealthContributorRegistry. The per-service include/exclude filters only control whether a given indicator's result accrues to the health status of a named service — they do not gate whether the indicator is invoked at all. This is silently activated by the presence of any BindableService bean (e.g. gRPC reflection) with no indication that external infrastructure probing will begin.
Desired behaviour: a server-wide filter to prevent specific indicators from being invoked by the gRPC health scheduler entirely, independently of actuator configuration.
Current workaround: include-overall-health: false, which is an all-or-nothing opt-out.
Putting exclude: mail per service does not stop MailHealthIndicator from running.
How should this be configured? Are we supposed to disable overall health?
Enhancement: is it possible to have a server wide filter (don't run mail at all) ?
Update: just realised that includeOverallHealth: false doesn't suppress the indicators.
This member is not actually used by anything:-
> grep -irnH includeOverallHealth
grpc/server/autoconfigure/health/GrpcServerHealthProperties.java:54: private boolean includeOverallHealth = true;
grpc/server/autoconfigure/health/GrpcServerHealthProperties.java:81: public boolean isIncludeOverallHealth() {
grpc/server/autoconfigure/health/GrpcServerHealthProperties.java:82: return this.includeOverallHealth;
grpc/server/autoconfigure/health/GrpcServerHealthProperties.java:85: public void setIncludeOverallHealth(boolean includeOverallHealth) {
grpc/server/autoconfigure/health/GrpcServerHealthProperties.java:86: this.includeOverallHealth = includeOverallHealth;
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with grpc/server/autoconfigure/health/GrpcServerHealthProperties.java and inspect how includeOverallHealth is defined and used. Trace the gRPC health scheduler's invocation of the global HealthContributorRegistry, then determine how a server-wide exclusion should be configured. Done means excluded indicators are not invoked while other health checks continue independently of actuator service filters.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100