← Back to Pull requests

feat: expose reuseConnection on active health checks #9741

Closed
unknown closed this pull request without merging on Oct 21, 2026 11:04 UTC
View on GitHub
unknown unknown commented on Aug 13, 2026 05:46 UTC
Author

Fixes #9694

What this does

Envoy's HealthCheck supports a reuse_connection field that controls whether the connection used for active health-check probes is reused across probes. Envoy Gateway never exposed it, so it was pinned to Envoy's default of true. This adds a reuseConnection field to the active health-check configuration.

Setting reuseConnection: false makes Envoy open a fresh connection for each probe — required to interoperate with backends (such as haproxy-style agent checks) that don't expect a reused connection.

Design

The field is added to the ActiveHealthCheck type and flows through the standard pipeline:

  • API — api/v1alpha1/healthcheck_types.go: ReuseConnection bool

  • IR — internal/ir/xds.go: ReuseConnection bool on ActiveHealthCheck

  • API → IR — internal/gatewayapi/clustersettings.go (buildActiveHealthCheck)

  • IR → xDS — internal/xds/translator/cluster.go (buildXdsHealthCheck) sets hc.ReuseConnection
  • When unset, Envoy's default (true) is preserved.

    Testing

    Generated code (deepcopy, CRDs, API reference docs) was regenerated with the repo's own tooling (controller-gen, crd-ref-docs).

  • Extended the translator health-check-host-hierarchy golden (asserts reuseConnection: false in the rendered Envoy health check)

  • Extended the gatewayapi backendtrafficpolicy-with-healthcheck fixture to exercise the API→IR conversion

  • Added TestBuildXdsHealthCheckReuseConnection covering unset / true / false
  • go test ./internal/xds/translator/ ./internal/gatewayapi/ ./internal/ir/ ./api/...
    go vet ./internal/xds/translator/ ./internal/gatewayapi/ ./internal/ir/ ./api/...
    

    ---

    This PR was authored with the assistance of Claude, an AI assistant.

    🤖 Generated with Claude Code

    Diff: 247 lines (+185 / -62) across 3 files Reviewer: vishals-3 Review duration: 99677m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.39) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 247 lines diff across 3 files
    0.39
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.330
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #9741"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 38.9% (MEDIUM) · Higher = larger blast radius
    38.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 16.8% · Safe to merge
    16.8%