You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(proxy): isolate and apply 30s timeout to upgrade proxy dialer (#4125)
This Pull Request resolves a critical P0 availability defect regarding
unbounded goroutine accumulation within the WebSocket and HTTP upgrade
proxy pathways under stalled backend conditions.
By replacing the blocking, context-less net.Dial and tls.Dial calls
inside dialBackend() with context-aware DialContext routines, the proxy
now correctly propagates req.Context() cancellation and enforces a
strict dial timeout.
The timeout has been fully wired into the proxy configuration factory,
defaulting to 30 seconds while allowing direct overrides via
Params.Timeout. Comprehensive regression and E2E timeout verification
tests have been integrated into proxy/upgrade_test.go.
---------
Signed-off-by: glatinone <93207632+glatinone@users.noreply.github.com>
flag.IntVar(&cfg.MaxHeaderBytes, "max-header-bytes", http.DefaultMaxHeaderBytes, "set MaxHeaderBytes for http server connections")
690
691
flag.BoolVar(&cfg.EnableConnMetricsServer, "enable-connection-metrics", false, "enables connection metrics for http server connections")
691
692
flag.DurationVar(&cfg.TimeoutBackend, "timeout-backend", 60*time.Second, "sets the TCP client connection timeout for backend connections")
693
+
flag.DurationVar(&cfg.UpgradeDialTimeout, "upgrade-dial-timeout", 0, "sets the explicit connect-time ceiling for websocket/spdy upgrade backend connections. Zero falls back to the built-in 30s default; negative disables the ceiling entirely")
692
694
flag.DurationVar(&cfg.KeepaliveBackend, "keepalive-backend", 30*time.Second, "sets the keepalive for backend connections")
693
695
flag.BoolVar(&cfg.EnableDualstackBackend, "enable-dualstack-backend", true, "enables DualStack for backend connections")
694
696
flag.DurationVar(&cfg.TlsHandshakeTimeoutBackend, "tls-timeout-backend", 60*time.Second, "sets the TLS handshake timeout for backend connections")
0 commit comments