Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Don't log ECONNRESET's between requests and during shutdown #1176

@halter73

Description

@halter73

Connection resets between requests are fairly common and benign, so Kestrel shouldn't log this even at the informational level. Simply closing the browser (in this case IE 10) after a normal browsing session can lead to scary looking logs like the following as the browser closes its idle connections:

info: Microsoft.AspNetCore.Server.Kestrel[14]
      Connection id "0HKVPEE3563UP" communication error
Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvException: Error -4077 ECONNRESET connection reset by peer
warn: Microsoft.AspNetCore.Server.Kestrel[0]
      Connection processing ended abnormally
System.IO.IOException: Error -4077 ECONNRESET connection reset by peer ---> Microsoft.AspNetCore.Server.Kestrel.Internal
.Networking.UvException: Error -4077 ECONNRESET connection reset by peer
   --- End of inner exception stack trace ---
   at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.SocketInput.CheckConnectionError()
   at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.Frame`1.<RequestProcessingAsync>d__2.MoveNext()
info: Microsoft.AspNetCore.Server.Kestrel[14]
      Connection id "0HKVPEE3563UQ" communication error
Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvException: Error -4077 ECONNRESET connection reset by peer
warn: Microsoft.AspNetCore.Server.Kestrel[0]
      Connection processing ended abnormally
System.IO.IOException: Error -4077 ECONNRESET connection reset by peer ---> Microsoft.AspNetCore.Server.Kestrel.Internal
.Networking.UvException: Error -4077 ECONNRESET connection reset by peer
   --- End of inner exception stack trace ---
   at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.SocketInput.CheckConnectionError()
   at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.Frame`1.<RequestProcessingAsync>d__2.MoveNext()

In the case where Kestrel already logs "Some connections failed to close gracefully during server shutdown," we could also avoid logging the ECONNRESET communication error for each connection that was forcibly closed. This I'm less sure about since the ECONNRESET logs include the ConnectionIds of the relevant connection which could be useful.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions