diff --git a/lib/ingestserver/conns_map.go b/lib/ingestserver/conns_map.go index 4b6c7c1f11..997a1df1d7 100644 --- a/lib/ingestserver/conns_map.go +++ b/lib/ingestserver/conns_map.go @@ -46,7 +46,7 @@ func (cm *ConnsMap) Delete(c net.Conn) { // CloseAll gradually closes all the cm conns with during the given shutdownDuration. func (cm *ConnsMap) CloseAll(shutdownDuration time.Duration) { cm.mu.Lock() - conns := make([]net.Conn, len(cm.m)) + conns := make([]net.Conn, 0, len(cm.m)) for c := range cm.m { conns = append(conns, c) delete(cm.m, c)