Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConnectAsync_CancellationRequestedAfterConnect_ThrowsOperationCanceledException #41511

Closed
ManickaP opened this issue Aug 28, 2020 · 14 comments
Closed
Labels
area-System.Net blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' test-bug Problem in test source code (most likely)
Milestone

Comments

@ManickaP
Copy link
Member

System.Net.WebSockets.Client.Tests

System.Net.NetworkException : The operation is not allowed on non-connected sockets.

net5.0-OSX-Debug-x64-Mono_release-OSX.1014.Amd64.Open

System.Net.NetworkException : The operation is not allowed on non-connected sockets.
   at System.Net.Sockets.NetworkStream..ctor(Socket socket, FileAccess access, Boolean ownsSocket) in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/NetworkStream.cs:line 81
   at System.Net.Sockets.NetworkStream..ctor(Socket socket, Boolean ownsSocket) in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/NetworkStream.cs:line 32
   at System.Net.Test.Common.LoopbackServer.EstablishConnectionAsync() in /_/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs:line 115
   at System.Net.Test.Common.LoopbackServer.AcceptConnectionAsync(Func`2 funcAsync) in /_/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs:line 121
   at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks) in /_/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs:line 96
   at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks) in /_/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs:line 124
   at System.Net.Test.Common.LoopbackServer.<>c__DisplayClass13_0.<<CreateClientAndServerAsync>b__0>d.MoveNext() in /_/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs:line 87
--- End of stack trace from previous location ---
   at System.Net.Test.Common.LoopbackServer.CreateServerAsync(Func`2 funcAsync, Options options) in /_/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs:line 71
   at System.Net.WebSockets.Client.Tests.ConnectTest.ConnectAsync_CancellationRequestedAfterConnect_ThrowsOperationCanceledException() in /_/src/libraries/System.Net.WebSockets.Client/tests/ConnectTest.cs:line 264
--- End of stack trace from previous location ---

https://dev.azure.com/dnceng/public/_build/results?buildId=790029&view=ms.vss-test-web.build-test-results-tab&runId=24931714&resultId=130442&paneView=debug

Hit in #41443

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-System.Net untriaged New issue has not been triaged by the area owner labels Aug 28, 2020
@ghost
Copy link

ghost commented Aug 28, 2020

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

@geoffkizer
Copy link
Contributor

geoffkizer commented Aug 29, 2020

(nevermind, this is coming from the loopback server)

@scalablecory scalablecory removed the untriaged New issue has not been triaged by the area owner label Aug 30, 2020
@scalablecory scalablecory added this to the 6.0.0 milestone Aug 30, 2020
@Anipik Anipik added the blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' label Sep 2, 2020
@jaredpar
Copy link
Member

jaredpar commented Sep 29, 2020

@ViktorHofer
Copy link
Member

@jaredpar should the link above work? The UI isn't doing anything for me when clicking on the Search button.

@jaredpar
Copy link
Member

jaredpar commented Oct 6, 2020

That is because there are no failures in last 14 days now. Basically the one failure was right on the edge and by the time you clicked it was gone. The site didn't do a good job of displaying "no results".

@lewing
Copy link
Member

lewing commented Oct 9, 2020

Failed today on release/5.0

@jaredpar
Copy link
Member

jaredpar commented Oct 9, 2020

@lewing can u provide a link to the build with the failure? Looking at the latest build against the linked PR I do not see this failure

https://dev.azure.com/dnceng/public/_build/results?buildId=846382&view=ms.vss-test-web.build-test-results-tab

@danmoseley danmoseley reopened this Nov 24, 2020
@danmoseley
Copy link
Member

This failed on a release/5.0 PR

System.Net.WebSockets.Client.Tests.ConnectTest.ConnectAsync_CancellationRequestedAfterConnect_ThrowsOperationCanceledException

Result Details
Failed Saturday
Duration0:00:00.013
Failing build20201121.17
Ownernot available
Date started11/21/2020, 3:54:46 PM
Date completed11/21/2020, 3:54:46 PM
Failing sinceSaturday

Debug

Work items

Attachments

History

Comments
{ "HelixJobId": "f4526b9c-aaf7-4a96-af61-b4397413431b", "HelixWorkItemName": "System.Net.WebSockets.Client.Tests" }


Error message
System.IO.IOException : The operation is not allowed on non-connected sockets.


Stack trace
   at System.Net.Sockets.NetworkStream..ctor(Socket socket, FileAccess access, Boolean ownsSocket) in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/NetworkStream.cs:line 57
   at System.Net.Sockets.NetworkStream..ctor(Socket socket, Boolean ownsSocket) in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/NetworkStream.cs:line 32
   at System.Net.Test.Common.LoopbackServer.EstablishConnectionAsync() in /_/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs:line 108
   at System.Net.Test.Common.LoopbackServer.AcceptConnectionAsync(Func`2 funcAsync) in /_/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs:line 121
   at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks) in /_/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs:line 96
   at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks) in /_/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs:line 124
   at System.Net.Test.Common.LoopbackServer.<>c__DisplayClass13_0.<<CreateClientAndServerAsync>b__0>d.MoveNext() in /_/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs:line 87
--- End of stack trace from previous location ---
   at System.Net.Test.Common.LoopbackServer.CreateServerAsync(Func`2 funcAsync, Options options) in /_/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs:line 71
   at System.Net.WebSockets.Client.Tests.ConnectTest.ConnectAsync_CancellationRequestedAfterConnect_ThrowsOperationCanceledException() in /_/src/libraries/System.Net.WebSockets.Client/tests/ConnectTest.cs:line 264
--- End of stack trace from previous location ---

https://dev.azure.com/dnceng/public/_build/results?buildId=895674&view=ms.vss-test-web.build-test-results-tab&runId=28623020&paneView=debug&resultId=139893
net5.0-OSX-Debug-x64-CoreCLR_release-OSX.1013.Amd64.Open

@lewing is there a fix to backport?

@lewing
Copy link
Member

lewing commented Nov 25, 2020

Probably worth a look, the failure rate on release/5.0 vs main definitely suggests something got fixed.

/cc @steveisok @marek-safar

@steveisok
Copy link
Member

I'm not sure. It seems to be hitting both runtimes. Once in the last 7 days on mono and 4 for coreclr and they both started happening on the 21st. #45062 was the first instance. Seems like a coincidence.

@wfurt
Copy link
Member

wfurt commented Nov 25, 2020

seems similar to #38159 and my attempt to fix it in #38900. AFAIK OSX fails certain calls if peer already started close ;(
Perhaps we should disable it on release branch to avoid noise.
And we track master failures weekly and it does not show there among top offenders.

@stephentoub
Copy link
Member

stephentoub commented Nov 25, 2020

@wfurt, seems we just need to backport #42054? The stack trace here shows an IOException coming from the loopback server, and that PR catches/eats all such exceptions.

@karelz
Copy link
Member

karelz commented Feb 12, 2021

Fixed in 6.0 (master) in PR #42054 and in 5.0.x in PR #45201.

@karelz karelz closed this as completed Feb 12, 2021
@karelz karelz added the test-bug Problem in test source code (most likely) label Feb 12, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Mar 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Net blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' test-bug Problem in test source code (most likely)
Projects
None yet
Development

No branches or pull requests