mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
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:
parent
6a533023b1
commit
3076c1f400
1 changed files with 1 additions and 2 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue