← Back to Pull requests

[CXP-527] Enable HTTP/2 PING keepalive in uhttp transport #844

Closed
unknown closed this pull request without merging on May 21, 2026 15:59 UTC
View on GitHub
unknown unknown commented on May 20, 2026 19:01 UTC
Author

Summary


  • Set ReadIdleTimeout and PingTimeout on the HTTP/2 transport so idle streams emit PING frames before intermediary idle timeouts fire.

  • Switches from http2.ConfigureTransport to http2.ConfigureTransports to access the http2.Transport.
  • Why


    Connectors running behind an egress proxy fronted by an NLB with a short TCP idle timeout (60s in our environment) hit http2: timeout awaiting response headers and connection reset by peer on slow paginated upstream responses. TCP keepalive does not cover the failure window because the kernel does not probe a socket with an outstanding write — exactly the state while waiting on response headers. HTTP/2 PING frames flow over the TLS tunnel as application bytes, resetting the NLB idle timer.

    Caveats


  • ForceAttemptHTTP2: true only attempts* HTTP/2. If the upstream's ALPN doesn't negotiate h2, the connection falls back to HTTP/1.1 and this PING keepalive does not apply — net/http's HTTP/1.1 transport has no equivalent application-layer keepalive. Connectors talking to HTTP/1.1-only upstreams through the same NLB will still see connection reset by peer on slow paginated responses.

  • PingTimeout = 15s matches the vendored x/net/http2 default; it is set explicitly as self-documentation alongside ReadIdleTimeout.
  • Test plan


  • go build ./... and go test ./pkg/uhttp/... (passing locally)

  • make lint (no new findings; 4 pre-existing gosec findings remain)

  • Vendor into a connector and exercise a long-running paginated sync through the proxy
  • Diff: 195 lines (+146 / -49) across 2 files Reviewer: arreyder Review duration: 1258m
    All Vouch review confidence checks passed
    Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.36 · 195 lines diff across 2 files
    0.36
    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%
    60%
    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.316
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #844"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% 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% (MEDIUM) · Higher = larger blast radius
    36%
    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: 60.5% · Lower = rushed or shallow review
    60.5%
    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: 14.2% · Safe to merge
    14.2%