Skip to content

Retain probe defaults when configuring other properties on probe health groups - #50296

Merged
wilkinsona merged 1 commit into
spring-projects:mainfrom
htjworld:fix/gh-40268
Sep 16, 2026
Merged

wilkinsona merged 1 commit into
spring-projects:mainfrom
htjworld:fix/gh-40268

Conversation

@htjworld

@htjworld htjworld commented May 5, 2026

Copy link
Copy Markdown
Contributor

Problem

Configuring additional-path (or other unrelated properties) on the
liveness or readiness health groups causes those groups to be
redefined via AutoConfiguredHealthEndpointGroups with an empty
include set, which matches all indicators rather than retaining the
probe defaults (livenessState/readinessState only). This can cause
Kubernetes probes to fail due to unrelated indicators (e.g. diskSpace,
rabbit).

Change

AvailabilityProbesHealthEndpointGroups now checks whether the user has
explicitly set include or exclude on a probe group via
HealthEndpointProperties. When neither is set, it wraps the existing
group in a DelegatingAvailabilityProbesHealthEndpointGroup with the
probe-specific member set, while delegating all other properties
(show-details, status aggregator, additional path, etc.) to the
existing group.

The fix is applied at the AvailabilityProbesHealthEndpointGroups
level rather than in AutoConfiguredHealthEndpointGroups because only
the probe layer knows which groups are probe groups and what their
default members are (livenessState, readinessState).

Tests

Added:

  • getWhenProbeInDelegateWithPropertiesGroupButNoMembershipRetainsProbeDefaults
    reproduces the exact bug scenario (additional-path set, no
    include/exclude)
  • getWhenProbeInDelegateWithNoExplicitMembershipRetainsProbeDefaults
  • getWhenReadinessProbeInDelegateWithNoExplicitMembershipRetainsProbeDefaults
  • getWhenProbeInDelegateWithExplicitIncludeReturnsOriginalGroup
    verifies that an explicitly configured include is still respected

Updated: getWhenProbeInDelegateReturnsOriginalGroup and
getWhenProbeInDelegateAndExistingAdditionalPathReturnsOriginalGroup
were asserting that the original group was returned unchanged — which
was the buggy behavior. These have been replaced by tests that assert
the corrected behavior.

Closes gh-40268

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue that has not yet been triaged. Contributions will not be accepted. label May 5, 2026
@htjworld
htjworld force-pushed the fix/gh-40268 branch 2 times, most recently from fab15cd to 695e192 Compare May 6, 2026 00:41
@wilkinsona wilkinsona self-assigned this Sep 11, 2026
@wilkinsona wilkinsona added type: enhancement A general enhancement and removed status: waiting-for-triage An issue that has not yet been triaged. Contributions will not be accepted. labels Sep 11, 2026
@wilkinsona wilkinsona added this to the 4.2.x milestone Sep 11, 2026
@@ -42,22 +42,27 @@
* @author Phillip Webb
* @author Brian Clozel
* @author Madhura Bhave
* @author htjworld

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Checkstyle requires @author to match .+\s.+. Would you prefer to update this or remove it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I've updated it to Taejin Han. I've also added the tag to the two test classes that this change modifies substantially. checkstyleMain and checkstyleTest now pass for the spring-boot-health module.

@@ -28,20 +28,24 @@
*
* @author Phillip Webb
* @author Madhura Bhave
* @author htjworld

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Checkstyle requires @author to match .+\s.+. Would you prefer to update this or remove it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated here as well.

@@ -28,23 +32,27 @@
* existing group.
*
* @author Madhura Bhave
* @author htjworld

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Checkstyle requires @author to match .+\s.+. Would you prefer to update this or remove it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated here as well.

@wilkinsona wilkinsona added the status: waiting-for-feedback We need additional information before we can continue label Sep 11, 2026
@wilkinsona wilkinsona removed the status: waiting-for-feedback We need additional information before we can continue label Sep 12, 2026
@wilkinsona wilkinsona modified the milestones: 4.2.x, 4.2.0-M2 Sep 16, 2026
@wilkinsona
wilkinsona merged commit c398259 into spring-projects:main Sep 16, 2026
3 checks passed
@wilkinsona

Copy link
Copy Markdown
Member

Thanks very much, @htjworld.

@htjworld
htjworld deleted the fix/gh-40268 branch September 16, 2026 12:52
@htjworld

Copy link
Copy Markdown
Contributor Author

Thank you very much for the review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Retain default group membership when configuring other properties on probe health groups

3 participants