lib/vmselectapi: do not log connection accept/close from vmselect

These log messages became too spammy in production clusters
after the commit 190c8b463c ,
which closes idle connections from vmselect to vmstorage.

Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/2508
This commit is contained in:
Aliaksandr Valialkin 2022-08-12 09:12:03 +03:00
parent 1b39be3305
commit 10402459d8
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1

View file

@ -129,7 +129,8 @@ func (s *Server) run() {
} }
logger.Panicf("FATAL: cannot process vmselect conns at %s: %s", s.ln.Addr(), err) logger.Panicf("FATAL: cannot process vmselect conns at %s: %s", s.ln.Addr(), err)
} }
logger.Infof("accepted vmselect conn from %s", c.RemoteAddr()) // Do not log connection accept from vmselect, since this can generate too many lines
// in the log because vmselect tends to re-establish idle connections.
if !s.connsMap.Add(c) { if !s.connsMap.Add(c) {
// The server is closed. // The server is closed.
@ -166,13 +167,8 @@ func (s *Server) run() {
} }
defer func() { defer func() {
if !s.isStopping() {
logger.Infof("closing vmselect conn from %s", c.RemoteAddr())
}
_ = bc.Close() _ = bc.Close()
}() }()
logger.Infof("processing vmselect conn from %s", c.RemoteAddr())
if err := s.processConn(bc); err != nil { if err := s.processConn(bc); err != nil {
if s.isStopping() { if s.isStopping() {
return return