Description
Arbitrary exceptions thrown from SocketConnection's receive and send loops are currently logged at the debug level.
This was done so app developers aren't spammed with useless warnings, but really it just shows the lack of confidence that we properly handle every Exception on every platform.
This might have been prudent when Kestrel's Socket transport was also distributed as a NuGet package meaning we didn't have complete control over what implementation of System.Net.Sockets we might be running on, but that's no longer the case. We should make sure we understand every exception that can be thrown, and catch their specific types.
It's fine leaving the catch (Exception ex)
block, but it should log a warning similar to what we do in Kestrel's HttpProtocol class.
aspnetcore/src/Servers/Kestrel/Core/src/Internal/Http/HttpProtocol.cs
Lines 589 to 592 in db6fbee
I think we should change this ASAP so we get feedback on previews. We should also verify that these unexpected connection error debug logs don't currently show up our functional tests.
I think we should do the same thing for unexpected errors in the QUIC transport.