← Back to Pull requests

data plane: retry failed TCP and UDP listener binds #1720

Open
unknown opened this pull request with 205 lines diff across 2 files
View on GitHub
unknown unknown commented on Dec 01, 2026 21:16 UTC
Author

Retry failed TCP and UDP listener binds in the data plane with exponential backoff until the port binds, the config no longer needs it, or the proxy closes.

Changes


  • pkg/proxy:

  • - Retry failed TCP and UDP listener binds with a shared retryPortBind helper using a stoppable time.Timer and exponential backoff from 50ms up to 30s, logging each failed attempt as an error.
    - Read the latest backends and limits (tcpMaxConnections, udpIdleTimeout, udpMaxSessions) under Proxy.mu when a retried bind succeeds rather than capturing values from the initial failure.
    - Cancel active retry loops when the config removes the port or when Proxy.Close runs.
    - Notify SetOnListenerBound after releasing Proxy.mu when a retried listener binds.
  • pkg/gari:

  • - Track pending revisions waiting for unbound TCP or UDP listeners so /_gari/applied keeps listing the previous revision until all required ports bind, then promotes the pending revision without a config change.
    - Validate listener filter options before mutating proxy or revision state so a later config that fails to apply does not discard an earlier pending revision.
  • Tests:

  • - TCP and UDP bind retry recovery, config/limit updates while retry is pending, and stopping retries on Close and port removal (pkg/proxy/tcp_test.go, pkg/proxy/udp_test.go).
    - Data-plane end-to-end tests verifying /_gari/applied lists the new revision once a blocked TCP or UDP port is freed, and verifying a later config failing to apply (missing client cert or invalid CIDR) preserves an earlier pending revision (pkg/gari/gari_test.go).

    Fixes #1279

    Diff: 205 lines (+153 / -52) across 2 files Reviewer: justinsb Review duration: 113m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.36) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.36 · 205 lines diff across 2 files
    0.36
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    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
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.319
    Real PR Conversation Timeline
    1 comments
    "Review active on #1720"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% 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: 36.3% (MEDIUM) · Higher = larger blast radius
    36.3%
    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: 46.7% · Lower = rushed or shallow review
    46.7%
    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: 19.4% · Safe to merge
    19.4%