SocketException 'Connection reset by peer' causing test failures on android_arm64 and android_x64
- Dominant language
- C#
- Stars
- 18.3k
- Forks
- 5.6k
- PR merge metrics
- PR metrics pending
Description
> **_Note:_** This issue was automatically generated by AI-Test-Triage. Please review and triage accordingly.
## Build Information
Build: [20251211.4](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1228756), [20251214.1](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1231039), [20251216.1](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1232841), [20251216.2](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1233488), [20260119.4](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1258627), [20260120.1](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1258961), [20260120.8](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1259961), [20260222.1](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1304943)
Build error leg or test failing: System.Net.Sockets.Tests.WorkItemExecution
Affected CI jobs: android_arm64_Release_NativeAOT, android_x64_Release_NativeAOT, build_android_arm64_Release_NativeAOT
### Causing Commit Range Information
Commit range: Flaky/Intermittent (no stable transition found)
## Summary
- Test failures caused by System.Net.Sockets.SocketException 'Connection reset by peer' during socket connect
- Failures occur in System.Net.Sockets.Tests suite on android_arm64_Release_NativeAOT and android_x64_Release_NativeAOT jobs
- Single test failures with connection reset errors observed in multi-connect and argument validation tests
- Test processes exit with code 1 indicating failure; one instance includes process killed by OS signal 9
- No infrastructure timeouts or crashes reported; failures linked to socket connection resets on Android platforms
## Failure Statistics
> _Note: These statistics are based on the configured time range and might not reflect the full history of the failure._
- **Occurrence Count**: 9
- **First Failure**: 2025-12-11 21:00:00 UTC
- **Last Failure**: 2026-02-23 07:02:47 UTC
## Work Items
| Work Item | Console Log | Build | Job Name |
|-----------|-------------|-------|----------|
| System.Net.Sockets.Tests | View Extract
12-11 14:58:53.992 25858 25882 I DOTNET : [FAIL] System.Net.Sockets.Tests.ConnectSyncForceNonBlocking.MultiConnect_LingerState_Preserved(dnsConnect: True)[Full Log](https://helixr1107v0xdeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-heads-main-5f707ab01e8a471482/System.Net.Sockets.Tests/1/console.59bd8277.log?helixlogtype=result) | [20251211.4](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1228756) | android_arm64_Release_NativeAOT |
12-11 14:58:53.992 25858 25882 I DOTNET : System.Net.Sockets.SocketException : Connection reset by peer [::ffff:127.0.0.1]:38615
12-11 14:58:53.992 25858 25882 I DOTNET : at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) + 0x238
12-11 14:58:53.992 25858 25882 I DOTNET : at System.Net.Sockets.Socket.Connect(EndPoint remoteEP) + 0x150
12-11 14:58:53.992 25858 25882 I DOTNET : at System.Net.Sockets.Socket.Connect(IPAddress[] addresses, Int32 port) + 0x114
...
12-11 14:59:01.904 1040 1040 I Zygote : Process 25858 exited due to signal 9 (Killed)
12-11 14:59:01.810 25858 25882 I DOTNET : Tests run: 2279, Errors: 0, Failures: 1, Skipped: 28. Time: 13.1907361s
12-11 14:59:01.811 25858 25877 I DOTNET : MonoRunner finished, return-code=1
| System.Net.Sockets.Tests | View Extract
[Full Log](https://helixr1107v0xdcypoyl9e7f.blob.core.windows.net/dotnet-runtime-refs-heads-main-14cbb38f544b43e1b2/System.Net.Sockets.Tests/1/console.6bb4f02a.log?helixlogtype=result) | [20251211.4](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1228756) | android_x64_Release_NativeAOT |
12-11 23:16:37.136 3931 3954 I DOTNET : [FAIL] System.Net.Sockets.Tests.ArgumentValidation.SelectPoll_InfiniteTimeSpan_Ok
12-11 23:16:37.136 3931 3954 I DOTNET : System.Net.Sockets.SocketException : Connection reset by peer 127.0.0.1:38893
12-11 23:16:37.136 3931 3954 I DOTNET : at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) + 0x1f6
12-11 23:16:37.136 3931 3954 I DOTNET : at System.Net.Sockets.Socket.Connect(EndPoint remoteEP) + 0x149
12-11 23:16:37.136 3931 3954 I DOTNET : at System.Net.Sockets.Tests.ArgumentValidation.SelectPoll_InfiniteTimeSpan_Ok() + 0x10b
12-11 23:16:37.136 3931 3954 I DOTNET : at libSystem.Net.Sockets.Tests!<BaseAddress>+0x16209a3
12-11 23:17:26.235 3931 3954 I DOTNET : Tests run: 2279, Errors: 0, Failures: 1, Skipped: 28. Time: 54.1153283s
12-11 23:17:26.236 3931 3949 I DOTNET : MonoRunner finished, return-code=1
[23:17:29] fail: Non-success instrumentation exit code: 1, expected: 0
| System.Net.Sockets.Tests | View Extract
12-14 02:55:59.926 25223 25254 I DOTNET : [FAIL] System.Net.Sockets.Tests.ConnectTask.MultiConnect_MiscProperties_Preserved(dnsConnect: False)[Full Log](https://helixr1107v0xdeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-heads-main-1c02fa1f085d4e1bb1/System.Net.Sockets.Tests.Attempt.2/1/console.52407f09.log?helixlogtype=result) | [20251214.1](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1231039) | android_arm64_Release_NativeAOT |
12-14 02:55:59.926 25223 25254 I DOTNET : System.Net.Sockets.SocketException : Connection reset by peer
12-14 02:55:59.926 25223 25254 I DOTNET : at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken) + 0x40
12-14 02:55:59.926 25223 25254 I DOTNET : at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token) + 0x5c
12-14 02:55:59.926 25223 25254 I DOTNET : at System.Net.Sockets.Socket.<<ConnectAsync>g__Core|293_0>d.MoveNext() + 0x208
12-14 02:55:59.926 25223 25254 I DOTNET : --- End of stack trace from previous location ---
| System.Net.Sockets.Tests | View Extract
12-16 14:53:04.999 8860 8884 I DOTNET : [FAIL] System.Net.Sockets.Tests.ConnectCancellableTask.Connect_ExposeHandle_FirstAttemptSucceeds(connectMode: "dns")[Full Log](https://helixr1107v0xdeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-heads-main-9a8bc8d905484d969e/System.Net.Sockets.Tests.Attempt.2/1/console.88661b8d.log?helixlogtype=result) | [20251216.2](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1233488) | android_arm64_Release_NativeAOT |
12-16 14:53:04.999 8860 8884 I DOTNET : System.Net.Sockets.SocketException : Connection reset by peer
12-16 14:53:04.999 8860 8884 I DOTNET : at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken) + 0x40
12-16 14:53:04.999 8860 8884 I DOTNET : at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token) + 0x5c
12-16 14:53:04.999 8860 8884 I DOTNET : at System.Threading.Tasks.ValueTask.ValueTaskSourceAsTask.<>c.<.cctor>b__4_0(Object state) + 0x7c
12-16 14:53:04.999 8860 8884 I DOTNET : --- End of stack trace from previous location ---
| System.Net.Sockets.Tests | View Extract
12-16 02:57:23.136 6942 6969 I DOTNET : [FAIL] System.Net.Sockets.Tests.ConnectSyncForceNonBlocking.MultiConnect_MiscProperties_Preserved(dnsConnect: True)[Full Log](https://helixr1107v0xdeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-heads-main-dde4907f8b3c4eed8f/System.Net.Sockets.Tests.Attempt.3/1/console.7413be6e.log?helixlogtype=result) | [20251216.1](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1232841) | android_arm64_Release_NativeAOT |
12-16 02:57:23.136 6942 6969 I DOTNET : System.Net.Sockets.SocketException : Connection reset by peer [::ffff:127.0.0.1]:42173
12-16 02:57:23.208 6942 6969 I DOTNET : at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) + 0x238
12-16 02:57:23.208 6942 6969 I DOTNET : at System.Net.Sockets.Socket.Connect(EndPoint remoteEP) + 0x150
12-16 02:57:23.208 6942 6969 I DOTNET : at System.Net.Sockets.Socket.Connect(IPAddress[] addresses, Int32 port) + 0x114
12-16 02:57:23.208 6942 6969 I DOTNET : --- End of stack trace from previous location ---
| System.Net.Sockets.Tests Work Item | View Extract
01-19 14:54:56.526 7273 7300 I DOTNET : [FAIL] System.Net.Sockets.Tests.ConnectCancellableTask.Connect_ExposeHandle_FirstAttemptSucceeds(connectMode: "single")[Full Log](https://helixr1107v0xdeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-heads-main-2f18c6a08bca427fa3/System.Net.Sockets.Tests.Attempt.2/1/console.29fac5a2.log?helixlogtype=result) | [20260119.4](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1258627) | build_android_arm64_Release_NativeAOT |
01-19 14:54:56.526 7273 7300 I DOTNET : System.Net.Sockets.SocketException : Connection reset by peer
01-19 14:54:56.526 7273 7300 I DOTNET : at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs:line 1361
01-19 14:54:56.526 7273 7300 I DOTNET : at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token) in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs:line 1277
01-19 14:55:08.547 7273 7300 I DOTNET : Finished System.Net.Sockets.Tests, Version=11.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
01-19 14:55:08.547 7273 7300 I DOTNET : Tests run: 2286, Errors: 0, Failures: 1, Skipped: 28. Time: 18.4498171s
01-19 14:55:08.548 7273 7292 I DOTNET : MonoRunner finished, return-code=1
01-19 14:55:08.681 1040 1040 I Zygote : Process 7273 exited due to signal 9 (Killed)
INSTRUMENTATION_RESULT: return-code=1
[14:55:11] fail: Non-success instrumentation exit code: 1, expected: 0
XHarness exit code: 1 (TESTS_FAILED)
| System.Net.Sockets.Tests Work Item | View Extract
01-20 03:01:52.759 18977 19087 I DOTNET : [FAIL] System.Net.Sockets.Tests.ConnectApm.MultiConnect_LingerState_Preserved(dnsConnect: True)[Full Log](https://helix.dot.net/api/jobs/71efe70a-9901-40e7-8ad0-c4bd47ac299e/workitems/System.Net.Sockets.Tests/files/console.d8211b6f.log?api-version=2019-06-17) | [20260120.1](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1258961) | build_android_arm64_Release_NativeAOT |
01-20 03:01:52.759 18977 19087 I DOTNET : System.Net.Sockets.SocketException : Connection reset by peer
01-20 03:01:52.759 18977 19087 I DOTNET : at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs:line 1361
01-20 03:01:52.759 18977 19087 I DOTNET : at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token) in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs:line 1277
01-20 03:02:05.568 1702 1721 V ActivityManager: Got obituary of 18977:net.dot.System.Net.Sockets.Tests
01-20 03:02:05.570 984 984 I Zygote : Process 18977 exited due to signal 9 (Killed)
01-20 03:02:05.571 1702 1828 I libprocessgroup: Successfully killed process cgroup uid 12907 pid 18977 in 207ms
[03:02:10] fail: Non-success instrumentation exit code: 1, expected: 0
INSTRUMENTATION_RESULT: return-code=1
INSTRUMENTATION_CODE: 1
[03:02:10] info: Attempting to remove apk 'net.dot.System.Net.Sockets.Tests'..
| System.Net.Sockets.Tests Work Item | View Extract
01-20 15:08:05.718 30874 30902 I DOTNET : [FAIL] System.Net.Sockets.Tests.ConnectCancellableTask.Connect_ExposeHandle_FirstAttemptSucceeds(connectMode: "dns")[Full Log](https://helix.dot.net/api/jobs/db152811-b035-4338-9326-68158b4ad950/workitems/System.Net.Sockets.Tests/files/console.0cf6bf5f.log?api-version=2019-06-17) | [20260120.8](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1259961) | build_android_arm64_Release_NativeAOT |
01-20 15:08:05.718 30874 30902 I DOTNET : System.Net.Sockets.SocketException : Connection reset by peer
01-20 15:08:05.718 30874 30902 I DOTNET : at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs:line 1361
01-20 15:08:05.718 30874 30902 I DOTNET : at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token) in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs:line 1277
01-20 15:08:12.467 1789 2060 I libprocessgroup: Successfully killed process cgroup uid 16576 pid 30874 in 6ms
01-20 15:08:12.609 1087 1087 I Zygote : Process 30874 exited due to signal 9 (Killed)
[15:08:13] fail: Non-success instrumentation exit code: 1, expected: 0
[15:08:13] info: Attempting to remove apk 'net.dot.System.Net.Sockets.Tests'..
XHarness exit code: 1 (TESTS_FAILED)
INSTRUMENTATION_RESULT: return-code=1
INSTRUMENTATION_CODE: 1
| System.Net.Sockets.Tests Work Item | View Extract
02-22 21:00:59.853 2972 3007 I DOTNET : [FAIL] System.Net.Sockets.Tests.ConnectApm.MultiConnect_LingerState_Preserved(dnsConnect: False)[Full Log](https://helix.dot.net/api/jobs/76f79e89-7d52-46b5-8a70-ee8d89a1528c/workitems/System.Net.Sockets.Tests/files/console.d4199bd9.log?api-version=2019-06-17) | [20260222.1](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1304943) | build_android_arm64_Release_NativeAOT |
02-22 21:00:59.853 2972 3007 I DOTNET : System.Net.Sockets.SocketException : Connection reset by peer
02-22 21:00:59.854 2972 3007 I DOTNET : at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs:line 1365
02-22 21:00:59.854 2972 3007 I DOTNET : at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token) in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs:line 1281
02-22 21:00:59.854 2972 3007 I DOTNET : at System.Net.Sockets.Socket.<<ConnectAsync>g__Core|294_0>d.MoveNext() in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs:line 187
...
INSTRUMENTATION_RESULT: return-code=1
INSTRUMENTATION_CODE: 1
[21:01:17] info: Instrumentation finished normally with exit code 1
[21:01:20] info: Wrote current ADB log to D:\h\w\A82D093C\w\A9F2099B\uploads\adb-logcat-net.dot.System.Net.Sockets.Tests-net.dot.MonoRunner.log
[21:01:20] info: Non-success instrumentation exit code: 1, expected: 0
XHarness exit code: 1 (TESTS_FAILED)
## Error Message
```json
{
"ErrorMessage": "System.Net.Sockets.SocketException : Connection reset by peer",
"BuildRetry": false,
"ExcludeConsoleLog": false
}
```
### Report
#### Summary
|24-Hour Hit Count|7-Day Hit Count|1-Month Count|
|---|---|---|
|0|0|0|
### Report
|Build|Repository|Test|Pull Request|
|---|---|---|---|
|[1587624](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1587624)|dotnet/runtime|[System.Net.Sockets.Tests.ArgumentValidation.Socket_ConnectAsync_IPv4AddressAsStringHost_Supported](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1587624&view=ms.vss-test-web.build-test-results-tab&runId=43817514&resultId=146554)||
|[1580135](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1580135)|dotnet/runtime|[System.Net.WebSockets.Client.Tests.ConnectTest_SharedHandler_Loopback.ConnectAndCloseAsync_UseProxyServer_ExpectedClosedState](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1580135&view=ms.vss-test-web.build-test-results-tab&runId=43586964&resultId=203417)|dotnet/runtime#133133|
|[1575585](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1575585)|dotnet/runtime|[System.Net.Sockets.Tests.ArgumentValidation.Socket_ConnectAsync_DnsEndPointWithIPAddressString_Supported](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1575585&view=ms.vss-test-web.build-test-results-tab&runId=43432986&resultId=134529)||
|[1571812](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1571812)|dotnet/runtime|[System.Net.Sockets.Tests.WorkItemExecution](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1571812&view=ms.vss-test-web.build-test-results-tab&runId=43290890&resultId=165101)||
|[1563754](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1563754)|dotnet/runtime|[System.Net.Sockets.Tests.ArgumentValidation.Socket_ConnectAsync_IPv6AddressAsStringHost_Supported](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1563754&view=ms.vss-test-web.build-test-results-tab&runId=43055826&resultId=147398)||
|[1561516](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1561516)|dotnet/runtime|[System.Net.WebSockets.Client.Tests.WorkItemExecution](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1561516&view=ms.vss-test-web.build-test-results-tab&runId=42994186&resultId=161471)||
|[1557346](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1557346)|dotnet/runtime|[System.Net.WebSockets.Client.Tests.WorkItemExecution](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1557346&view=ms.vss-test-web.build-test-results-tab&runId=42867396&resultId=196752)|dotnet/runtime#132467|
#### Summary
|24-Hour Hit Count|7-Day Hit Count|1-Month Count|
|---|---|---|
|0|1|7|
Contributor guide
Assessment
This issue has not been assessed yet.