mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2026-05-17 08:36:55 +03:00
Previously After RoundTrip returns successfully (err == nil, res != nil), the code checks if the original client request's context was canceled. If canceled, it returns immediately without closing res.Body. There is a race window where: 1) RoundTrip completes successfully (res is non-nil) 2) The client cancels the request context (closes connection) 3) The context check at line 484 sees the cancellation 4) The function returns without closing res.Body The response body holds a reference to the underlying TCP connection. Without closing it, the connection is permanently leaked along with the transport goroutines (readLoop + writeLoop or dialConnFor). bug was introduced at https://github.com/VictoriaMetrics/VictoriaMetrics/pull/10233 Fixes https://github.com/VictoriaMetrics/VictoriaMetrics/issues/10833