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

Translate all ObjectDisposedExceptions to SocketExceptions in MultipleConnectAsync.AttemptConnection #35965

Merged
merged 1 commit into from
May 8, 2020

Conversation

stephentoub
Copy link
Member

If ObjectDisposedExceptions occurred at unexpected times, we'd return that ObjectDisposedException rather than a SocketException for OperationAborted. Higher-levels would then treat that arbitrary exception as a generic SocketError. So net net, this means that consuming code would get a SocketException for the more generic SocketError.SocketError rather than the more specific SocketError.OperationAborted.

The test in #35886 is looking specifically for OperationAborted. Rather than change it to include SocketError or other error codes, this maps more cases to OperationAborted. I don't know if there are others we'll hit as well.

Fixes #35886

…eConnectAsync.AttemptConnection

If ObjectDisposedExceptions occurred at unexpected times, we'd return that ObjectDisposedException rather than a SocketException for OperationAborted.  Higher-levels would then treat that arbitrary exception as a generic SocketError. So net net, this means that consuming code would get a SocketException for the more generic SocketError.SocketError rather than the more specific SocketError.OperationAborted.
@ghost
Copy link

ghost commented May 7, 2020

Tagging subscribers to this area: @dotnet/ncl
Notify danmosemsft if you want to be subscribed.

@davidsh davidsh added this to the 5.0 milestone May 7, 2020
Copy link
Member

@wfurt wfurt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
I did 100+ test runs and everything seems stable.

@stephentoub
Copy link
Member Author

Thanks.

@stephentoub stephentoub merged commit 43b5d81 into dotnet:master May 8, 2020
@stephentoub stephentoub deleted the socketfixes branch May 8, 2020 00:02
@ghost ghost locked as resolved and limited conversation to collaborators Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test failure: System.Net.Sockets.Tests.TcpClientTest.Dispose_CancelsConnectAsync
4 participants