[SSL] SslStress intermittently fails with SocketException (995)
- Dominant language
- C#
- Stars
- 18.3k
- Forks
- 5.6k
- PR merge metrics
- PR metrics pending
Description
~3x occurrences per month
Details:
```
System.IO.IOException: Unable to read data from the transport connection: The I/O operation has been aborted because of either a thread exit or an application request..
---> System.Net.Sockets.SocketException (995): The I/O operation has been aborted because of either a thread exit or an application request.
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.CreateException(SocketError error, Boolean forAsyncThrow) in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs:line 1370
at SslStress.Utils.CountingStream.ReadAsync(Memory`1 buffer, CancellationToken cancellationToken) in C:\app\System.Net.Security\tests\StressTests\SslStress\Utils\CountingStream.cs:line 64
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncMethodBuilderCore.cs:line 38
at System.Net.Security.SslStream.EnsureFullTlsFrameAsync[TIOAdapter](CancellationToken cancellationToken, Int32 estimatedSize)
at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](Memory`1 buffer, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.IO.cs:line 896
at System.IO.Pipelines.PipeWriter.CopyFromAsync(Stream source, CancellationToken cancellationToken) in /_/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/PipeWriter.cs:line 128
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs:line 179
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext() in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncTaskMethodBuilderT.cs:line 350
at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](Memory`1 buffer, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.IO.cs:line 990
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs:line 179
at System.Net.Security.SslStream.EnsureFullTlsFrameAsync[TIOAdapter](CancellationToken cancellationToken, Int32 estimatedSize) in /_/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.IO.cs:line 802
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs:line 179
at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(IAsyncStateMachineBox box, Boolean allowInlining) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/TaskContinuation.cs:line 795
at System.Threading.Tasks.Task.RunContinuations(Object continuationObject) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 3475
at SslStress.Utils.CountingStream.ReadAsync(Memory`1 buffer, CancellationToken cancellationToken) in C:\app\System.Net.Security\tests\StressTests\SslStress\Utils\CountingStream.cs:line 67
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs:line 179
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext() in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncTaskMethodBuilderT.cs:line 350
at System.Threading.ThreadPoolBoundHandleOverlapped.CompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandleOverlapped.cs:line 36
at System.Threading.ThreadPoolTypedWorkItemQueue.System.Threading.IThreadPoolWorkItem.Execute() in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolWorkQueue.cs:line 1430
at System.Threading.ThreadPoolWorkQueue.Dispatch() in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolWorkQueue.cs:line 1154
at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() in /_/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.WorkerThread.cs:line 118
at System.Threading.Thread.StartCallback() in /_/src/coreclr/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs:line 104
--- End of stack trace from previous location ---
--- End of inner exception stack trace ---
at SslStress.Utils.CountingStream.ReadAsync(Memory`1 buffer, CancellationToken cancellationToken) in C:\app\System.Net.Security\tests\StressTests\SslStress\Utils\CountingStream.cs:line 64
at System.Net.Security.SslStream.EnsureFullTlsFrameAsync[TIOAdapter](CancellationToken cancellationToken, Int32 estimatedSize) in /_/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.IO.cs:line 765
at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token) in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/PoolingAsyncValueTaskMethodBuilderT.cs:line 422
at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](Memory`1 buffer, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.IO.cs:line 896
at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token) in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/PoolingAsyncValueTaskMethodBuilderT.cs:line 422
at System.IO.Pipelines.PipeWriter.CopyFromAsync(Stream source, CancellationToken cancellationToken) in /_/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/PipeWriter.cs:line 128
at SslStress.Utils.PipeExtensions.<>c__DisplayClass0_0.<g__FillPipeAsync|0>d.MoveNext() in C:\app\System.Net.Security\tests\StressTests\SslStress\Utils\PipeExtensions.cs:line 33
--- End of stack trace from previous location ---
at SslStress.Utils.StressTaskExtensions.<>c__DisplayClass0_0.<g__RunOne|0>d.MoveNext() in C:\app\System.Net.Security\tests\StressTests\SslStress\Utils\StressTaskExtensions.cs:line 39
--- End of stack trace from previous location ---
at SslStress.Utils.StressTaskExtensions.WhenAllThrowOnFirstException(CancellationToken token, Func`2[] tasks) in C:\app\System.Net.Security\tests\StressTests\SslStress\Utils\StressTaskExtensions.cs:line 32
at SslStress.Utils.PipeExtensions.ReadLinesUsingPipesAsync(Stream stream, Func`2 callback, CancellationToken token, Char separator) in C:\app\System.Net.Security\tests\StressTests\SslStress\Utils\PipeExtensions.cs:line 22
at SslStress.StressClient.<>c__DisplayClass2_0.<g__Receiver|1>d.MoveNext() in C:\app\System.Net.Security\tests\StressTests\SslStress\StressOperations.cs:line 303
--- End of stack trace from previous location ---
at SslStress.Utils.StressTaskExtensions.<>c__DisplayClass0_0.<g__RunOne|0>d.MoveNext() in C:\app\System.Net.Security\tests\StressTests\SslStress\Utils\StressTaskExtensions.cs:line 39
--- End of stack trace from previous location ---
at SslStress.Utils.StressTaskExtensions.WhenAllThrowOnFirstException(CancellationToken token, Func`2[] tasks) in C:\app\System.Net.Security\tests\StressTests\SslStress\Utils\StressTaskExtensions.cs:line 32
at SslStress.StressClient.HandleConnection(Int32 workerId, Int64 jobId, SslStream stream, TcpClient client, Random random, TimeSpan duration, CancellationToken token) in C:\app\System.Net.Security\tests\StressTests\SslStress\StressOperations.cs:line 236
at SslStress.SslClientBase.g__RunSingleWorker|15_1(Int32 workerId, Random random) in C:\app\System.Net.Security\tests\StressTests\SslStress\SslClientBase.cs:line 119
```
Contributor guide
Assessment
This issue has not been assessed yet.