Fix listener is closed log spam (#5581)

This commit is contained in:
Roman Tkachenko 2021-02-16 18:12:44 -08:00 committed by GitHub
parent 5739b63e51
commit 524b13f8b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -119,7 +119,7 @@ func (s *ProxyServer) Serve(listener net.Listener) error {
// The connection is expected to come through via multiplexer.
clientConn, err := listener.Accept()
if err != nil {
if strings.Contains(err.Error(), teleport.UseOfClosedNetworkConnection) {
if strings.Contains(err.Error(), teleport.UseOfClosedNetworkConnection) || trace.IsConnectionProblem(err) {
return nil
}
return trace.Wrap(err)