Skip to content

Commit

Permalink
lib/ingestserver: properly log the number of closed connections
Browse files Browse the repository at this point in the history
Previously there was off-by-one error, which resulted in logging len(conns-1) connections instead of len(conns)

Updates VictoriaMetrics#4922
  • Loading branch information
valyala authored and Andrew Chubatiuk committed Nov 15, 2023
1 parent 9576b9e commit c631f54
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/ingestserver/conns_map.go
Expand Up @@ -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()
Expand Down

0 comments on commit c631f54

Please sign in to comment.