Delete NetEventSource.Fail (#43579)
authorStephen Toub <stoub@microsoft.com>
Wed, 21 Oct 2020 17:33:59 +0000 (13:33 -0400)
committerGitHub <noreply@github.com>
Wed, 21 Oct 2020 17:33:59 +0000 (13:33 -0400)
commit001edea339524536f235ef093f584e7c94c909af
tree7626d5d8220ea7d24d5e9825db4bd30d33261722
parent2a234f91fc654381d5bd2d001c59c48b3634b4ab
Delete NetEventSource.Fail (#43579)

At some point some Debug.Asserts/Fails were replaced by this NetEventSource.Fail helper, which both Debug.Fails and fires an EventSource event.  But asserts in our code base are intended for things that should never happen, and we needn't be emitting events for them (if we did want to emit events for them, we'd need to tackle the other ~20,000 Debug.Assert/Fails in the codebase.

I've deleted NetEventSource.Fail, and fixed up the call sites.  Some were simply replaced by Debug.Assert/Fail.  Some were deleted entirely, when from code inspection it looked like they could actually be hit, but were guarded by a check for the event source being enabled and thus were unlikely to have been triggered in our previous testing.  Etc.
28 files changed:
src/libraries/Common/src/Interop/Windows/SspiCli/SSPIAuthType.cs
src/libraries/Common/src/Interop/Windows/SspiCli/SSPIWrapper.cs
src/libraries/Common/src/System/Net/ContextAwareResult.cs
src/libraries/Common/src/System/Net/Http/aspnetcore/NetEventSource.Common.cs
src/libraries/Common/src/System/Net/InternalException.cs
src/libraries/Common/src/System/Net/LazyAsyncResult.cs
src/libraries/Common/src/System/Net/Logging/NetEventSource.Common.cs
src/libraries/Common/src/System/Net/NTAuthentication.Common.cs
src/libraries/Common/src/System/Net/Security/NegotiateStreamPal.Unix.cs
src/libraries/Common/src/System/Net/Security/SSPIHandleCache.cs
src/libraries/Common/src/System/Net/Security/SecurityBuffer.Windows.cs
src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpConnection.cs
src/libraries/System.Net.Primitives/tests/PalTests/Fakes/NetEventSource.cs
src/libraries/System.Net.Requests/src/System/Net/FtpControlStream.cs
src/libraries/System.Net.Requests/src/System/Net/FtpWebRequest.cs
src/libraries/System.Net.Requests/src/System/Net/TimerThread.cs
src/libraries/System.Net.Security/src/System/Net/CertificateValidationPal.Windows.cs
src/libraries/System.Net.Security/src/System/Net/CertificateValidationPal.cs
src/libraries/System.Net.Security/src/System/Net/Security/NegotiateStreamPal.Windows.cs
src/libraries/System.Net.Security/src/System/Net/Security/SecureChannel.cs
src/libraries/System.Net.Security/src/System/Net/Security/SslSessionsCache.cs
src/libraries/System.Net.Security/src/System/Net/Security/SslStream.Implementation.cs
src/libraries/System.Net.Security/src/System/Net/Security/SslStreamPal.Windows.cs
src/libraries/System.Net.Sockets/src/System/Net/Sockets/BaseOverlappedAsyncResult.Windows.cs
src/libraries/System.Net.Sockets/src/System/Net/Sockets/MultipleConnectAsync.cs
src/libraries/System.Net.Sockets/src/System/Net/Sockets/NetEventSource.Sockets.cs
src/libraries/System.Net.Sockets/src/System/Net/Sockets/SafeSocketHandle.cs
src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs