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

Allow XdsEndpointGroup to disable health checking per Endpoint #5879

Merged
merged 3 commits into from
Nov 7, 2024

Conversation

jrhee17
Copy link
Contributor

@jrhee17 jrhee17 commented Aug 20, 2024

Motivation:

While working on documentation, I realized that disable_active_health_check is not supported.
ref: https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/endpoint/v3/endpoint_components.proto#config-endpoint-v3-endpoint-healthcheckconfig

This can be useful when users would like to force certain endpoints to be healthy without health checking.

Modifications:

  • Renamed HttpHealthChecker to DefaultHttpHealthChecker
  • Introduced the HttpHealthChecker interface
  • Introduced StaticHttpHealthChecker which sets the health status immediately
  • Refer to HealthCheckConfig#getDisableActiveHealthCheck and decide whether to return a StaticHttpHealthChecker

Result:

  • disable_active_health_check is now supported

@jrhee17 jrhee17 added this to the 1.31.0 milestone Aug 20, 2024
@jrhee17 jrhee17 marked this pull request as ready for review August 20, 2024 11:20
Copy link
Member

@minwoox minwoox left a comment

Choose a reason for hiding this comment

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

👍 👍 👍

Copy link
Member

@minwoox minwoox left a comment

Choose a reason for hiding this comment

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

👍 👍 👍

Copy link
Contributor

@ikhoon ikhoon left a comment

Choose a reason for hiding this comment

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

Overall, looks good. Left minor comments.

ClientRequestContext.of(HttpRequest.of(HttpMethod.GET, "/"));

private StaticHttpHealthChecker(HealthCheckerContext ctx, double healthy) {
ctx.updateHealth(healthy, NOOP_CTX, null, null);
Copy link
Contributor

Choose a reason for hiding this comment

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

How about specifying null instead of a mock context? I think that would be more clear.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Modified the contract of updateHealth to accept a @Nullable

@github-actions github-actions bot added the Stale label Oct 15, 2024
@github-actions github-actions bot removed the Stale label Nov 6, 2024
Copy link
Contributor

@ikhoon ikhoon left a comment

Choose a reason for hiding this comment

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

Nice work!

@ikhoon ikhoon merged commit 011741d into line:main Nov 7, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants