Develop#490
Conversation
…HTTP/2 leak http.DefaultTransport can be mutated at boot by other libraries (notably OpenTelemetry registering an h2 handler in TLSNextProto). Cloning it inherited that handler, so HTTPS connections negotiated HTTP/2 via ALPN and hit the stdlib hpack encoder issue under the concurrent-goroutine usage pattern of this client — reproduced in production on 2026-04-10 (61 errors on reporter-manager, 14 on reporter-worker, circuit-breaker cascade, 503s). Replace the Clone()-based construction with an explicit *http.Transport. TLSNextProto is initialized to a non-nil empty map (the stdlib opt-out signal). Proxy, DialContext, TLS, pool and timeout settings are now set explicitly, no longer inherited from a mutable global. HTTP/1.1 is the deliberate choice for this client because middleware and async revalidation share the same host concurrently. Adds client_transport_test.go with regression tests that contaminate http.DefaultTransport with an h2 handler and assert it does not leak into the client, plus pinning tests for pool and timeout defaults. Refs: docs/lib-commons/incidents/2026-04-10-http2-protocol-mismatch.md Generated-by: Claude AI-Model: claude-opus-4-7
fix: build HTTP transport explicitly to avoid HTTP/2 leak
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThe PR refactors HTTP client construction in ChangesHTTP/2 Opt-out for Isolated HTTP Client
Comment |
🔍 PR Validation Summary🚫 PR Blocked — 2 blocking failures
|
🔒 Security Scan Results —
|
| Stage | Status | Blocking? |
|---|---|---|
| Filesystem Scan | ✅ Clean | — |
| Docker Image Scan | ➖ Skipped | — |
| Docker Hub Health Score | ➖ Skipped | — |
| Pre-release Version Check | ✅ Clean | — |
Trivy
Filesystem Scan
✅ No vulnerabilities or secrets found.
Pre-release Version Check
✅ No unstable version pins found.
📊 Unit Test Coverage Report:
|
| Metric | Value |
|---|---|
| Overall Coverage | 87.0% ✅ PASS |
| Threshold | 80% |
Coverage by Package
| Package | Coverage |
|---|---|
github.com/LerianStudio/lib-commons/v5/commons/backoff |
91.1% |
github.com/LerianStudio/lib-commons/v5/commons/certificate |
88.8% |
github.com/LerianStudio/lib-commons/v5/commons/circuitbreaker |
86.8% |
github.com/LerianStudio/lib-commons/v5/commons/cron |
94.2% |
github.com/LerianStudio/lib-commons/v5/commons/crypto |
95.6% |
github.com/LerianStudio/lib-commons/v5/commons/dlq |
81.0% |
github.com/LerianStudio/lib-commons/v5/commons/errgroup |
86.1% |
github.com/LerianStudio/lib-commons/v5/commons/internal/nilcheck |
100.0% |
github.com/LerianStudio/lib-commons/v5/commons/jwt |
89.4% |
github.com/LerianStudio/lib-commons/v5/commons/license |
96.9% |
github.com/LerianStudio/lib-commons/v5/commons/mongo |
89.0% |
github.com/LerianStudio/lib-commons/v5/commons/net/http/idempotency |
93.0% |
github.com/LerianStudio/lib-commons/v5/commons/net/http/ratelimit |
90.8% |
github.com/LerianStudio/lib-commons/v5/commons/net/http |
96.1% |
github.com/LerianStudio/lib-commons/v5/commons/outbox |
91.8% |
github.com/LerianStudio/lib-commons/v5/commons/pointers |
100.0% |
github.com/LerianStudio/lib-commons/v5/commons/postgres |
84.6% |
github.com/LerianStudio/lib-commons/v5/commons/rabbitmq |
89.3% |
github.com/LerianStudio/lib-commons/v5/commons/redis |
89.5% |
github.com/LerianStudio/lib-commons/v5/commons/safe |
99.6% |
github.com/LerianStudio/lib-commons/v5/commons/secretsmanager |
98.7% |
github.com/LerianStudio/lib-commons/v5/commons/security/ssrf |
95.9% |
github.com/LerianStudio/lib-commons/v5/commons/security |
100.0% |
github.com/LerianStudio/lib-commons/v5/commons/server |
87.3% |
github.com/LerianStudio/lib-commons/v5/commons/tenant-manager/cache |
97.9% |
github.com/LerianStudio/lib-commons/v5/commons/tenant-manager/client |
93.5% |
github.com/LerianStudio/lib-commons/v5/commons/tenant-manager/consumer |
87.9% |
github.com/LerianStudio/lib-commons/v5/commons/tenant-manager/core |
99.0% |
github.com/LerianStudio/lib-commons/v5/commons/tenant-manager/event |
95.7% |
github.com/LerianStudio/lib-commons/v5/commons/tenant-manager/internal/eviction |
100.0% |
github.com/LerianStudio/lib-commons/v5/commons/tenant-manager/log |
100.0% |
github.com/LerianStudio/lib-commons/v5/commons/tenant-manager/middleware |
92.3% |
github.com/LerianStudio/lib-commons/v5/commons/tenant-manager/mongo |
76.3% |
github.com/LerianStudio/lib-commons/v5/commons/tenant-manager/postgres |
86.8% |
github.com/LerianStudio/lib-commons/v5/commons/tenant-manager/rabbitmq |
82.6% |
github.com/LerianStudio/lib-commons/v5/commons/tenant-manager/redis |
93.8% |
github.com/LerianStudio/lib-commons/v5/commons/tenant-manager/s3 |
96.3% |
github.com/LerianStudio/lib-commons/v5/commons/tenant-manager/tenantcache |
98.4% |
github.com/LerianStudio/lib-commons/v5/commons/tenant-manager/valkey |
100.0% |
github.com/LerianStudio/lib-commons/v5/commons/transaction |
95.1% |
github.com/LerianStudio/lib-commons/v5/commons/webhook |
91.5% |
github.com/LerianStudio/lib-commons/v5/commons |
96.4% |
Generated by Go PR Analysis workflow
No description provided.