Skip to content

spring.grpc.server.health.include-overall-health is not taken into account#50799

Merged
snicoll merged 2 commits into
spring-projects:4.1.xfrom
xfocus3:gh-50791-grpc-health-overall
Jul 23, 2026
Merged

spring.grpc.server.health.include-overall-health is not taken into account#50799
snicoll merged 2 commits into
spring-projects:4.1.xfrom
xfocus3:gh-50791-grpc-health-overall

Conversation

@xfocus3

@xfocus3 xfocus3 commented Jun 20, 2026

Copy link
Copy Markdown

Fixes gh-50791

spring.grpc.server.health.include-overall-health=false was bound but not used by the auto-configured gRPC health components. The overall server component was always created, so scheduled gRPC health updates still evaluated all health contributors even when overall health reporting was disabled.

This change makes the auto-configured server component nullable and omits it when overall health reporting is disabled. Service-specific health components continue to be created from spring.grpc.server.health.service.* settings.

Verification:

  • RED: ./gradlew :module:spring-boot-grpc-server:test --tests org.springframework.boot.grpc.server.autoconfigure.health.AutoConfiguredHealthCheckedGrpcComponentsTests.getServerWhenIncludeOverallHealthIsFalseReturnsNull --no-daemon failed before the fix.
  • GREEN: ./gradlew :module:spring-boot-grpc-server:test --tests org.springframework.boot.grpc.server.autoconfigure.health.AutoConfiguredHealthCheckedGrpcComponentsTests.getServerWhenIncludeOverallHealthIsFalseReturnsNull --tests org.springframework.boot.grpc.server.autoconfigure.health.GrpcServerHealthAutoConfigurationTests.whenIncludeOverallHealthIsFalseDoesNotReportOverallHealth --no-daemon
  • GREEN: ./gradlew :module:spring-boot-grpc-server:test --tests org.springframework.boot.grpc.server.autoconfigure.health.AutoConfiguredHealthCheckedGrpcComponentsTests --tests org.springframework.boot.grpc.server.autoconfigure.health.GrpcServerHealthAutoConfigurationTests --no-daemon
  • GREEN: ./gradlew :module:spring-boot-grpc-server:checkstyleMain :module:spring-boot-grpc-server:checkstyleTest --no-daemon
  • GREEN: git diff --check HEAD^ HEAD

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 20, 2026
@snicoll snicoll added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 22, 2026
@snicoll snicoll self-assigned this Jul 22, 2026
@snicoll snicoll changed the title Honor include-overall-health in gRPC health spring.grpc.server.health.include-overall-health is not taken into account Jul 22, 2026
@snicoll snicoll added this to the 4.1.1 milestone Jul 23, 2026
Ahmed El amraouiyine and others added 2 commits July 23, 2026 14:16
@snicoll
snicoll force-pushed the gh-50791-grpc-health-overall branch from da79c9c to e2b4c93 Compare July 23, 2026 12:21
@snicoll
snicoll changed the base branch from main to 4.1.x July 23, 2026 12:21
@snicoll
snicoll merged commit ace3066 into spring-projects:4.1.x Jul 23, 2026
2 of 3 checks passed
@snicoll

snicoll commented Jul 23, 2026

Copy link
Copy Markdown
Member

Thanks @xfocus3 ! I am not sure it completely fixes the related issue so I've left it open.

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.

Spring gRPC health check triggers MailHealthIndicator eagerly

3 participants