lib/ingestserver: properly log the number of closed connections

Previously there was off-by-one error, which resulted in logging len(conns-1) connections instead of len(conns)

Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4922
This commit is contained in:
Aliaksandr Valialkin 2023-11-14 21:52:20 +01:00
parent 6a533023b1
commit 3076c1f400
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1

View file

@ -82,8 +82,7 @@ func (cm *ConnsMap) CloseAll(shutdownDuration time.Duration) {
remoteAddr := conns[0].RemoteAddr().String()
_ = conns[0].Close()
logger.Infof("closed %s connection %s", cm.clientName, remoteAddr)
conns = conns[1:]
for _, c := range conns {
for _, c := range conns[1:] {
time.Sleep(shutdownInterval)
remoteAddr := c.RemoteAddr().String()
_ = c.Close()