Skip to content

Do not throw ObjectDisposeException from Socket.EndXyz methods - #73335

Merged
antonfirsov merged 9 commits into
dotnet:mainfrom
antonfirsov:socket-apm-nodisposecheck
Aug 5, 2022
Merged

antonfirsov merged 9 commits into
dotnet:mainfrom
antonfirsov:socket-apm-nodisposecheck

Conversation

@antonfirsov

Copy link
Copy Markdown
Contributor

Fixes #61411 and cleans up some null-reference exception handling.

Considering (1) the amount of test changes (2) the fact that we are documenting ODE (3) complaints like #41585, I think it's reasonable to mark this change as breaking.

@antonfirsov antonfirsov added area-System.Net.Sockets breaking-change Issue or PR that represents a breaking API or functional change over a previous release. labels Aug 3, 2022
@antonfirsov antonfirsov added this to the 7.0.0 milestone Aug 3, 2022
@antonfirsov
antonfirsov requested a review from stephentoub August 3, 2022 22:39
@ghost ghost assigned antonfirsov Aug 3, 2022
@ghost

ghost commented Aug 3, 2022

Copy link
Copy Markdown

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

Issue Details

Fixes #61411 and cleans up some null-reference exception handling.

Considering (1) the amount of test changes (2) the fact that we are documenting ODE (3) complaints like #41585, I think it's reasonable to mark this change as breaking.

Author: antonfirsov
Assignees: -
Labels:

area-System.Net.Sockets, breaking-change

Milestone: 7.0.0

@ghost ghost added the needs-breaking-change-doc-created Breaking changes need an issue opened with https://github.com/dotnet/docs/issues/new?template=dotnet label Aug 3, 2022
@ghost

ghost commented Aug 3, 2022

Copy link
Copy Markdown

Added needs-breaking-change-doc-created label because this PR has the breaking-change label.

When you commit this breaking change:

  1. Create and link to this PR and the issue a matching issue in the dotnet/docs repo using the breaking change documentation template, then remove this needs-breaking-change-doc-created label.
  2. Ask a committer to mail the .NET Breaking Change Notification DL.

Tagging @dotnet/compat for awareness of the breaking change.

@antonfirsov

Copy link
Copy Markdown
Contributor Author

/azp run runtime-libraries-coreclr outerloop

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@antonfirsov
antonfirsov requested a review from a team August 3, 2022 22:44
@karelz
karelz requested a review from MihaZupan August 4, 2022 15:51
@karelz

karelz commented Aug 4, 2022

Copy link
Copy Markdown
Member

Triage: Throwing different exception in situation like this is NOT considered a breaking change. It is a technical breaking change, we do not plan to document, unless we see it has real-world impact on customers and causes confusion. Removing the labels.

@karelz karelz removed breaking-change Issue or PR that represents a breaking API or functional change over a previous release. needs-breaking-change-doc-created Breaking changes need an issue opened with https://github.com/dotnet/docs/issues/new?template=dotnet labels Aug 4, 2022
@antonfirsov

Copy link
Copy Markdown
Contributor Author

/azp run runtime-libraries-coreclr outerloop

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

throw new ArgumentException(null, nameof(asyncResult));
throw asyncResult is null ?
new ArgumentNullException(nameof(asyncResult)) :
new ArgumentException(null, nameof(asyncResult));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this a separate fix to throw a more specific exception?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is to match the behavior of methods which simply delegate to TaskToApm:

private static void ThrowArgumentException(IAsyncResult asyncResult)
{
throw asyncResult is null ?
new ArgumentNullException(nameof(asyncResult)) :
new ArgumentException(null, nameof(asyncResult));
}

@dotnet dotnet deleted a comment from azure-pipelines Bot Aug 5, 2022
@antonfirsov

Copy link
Copy Markdown
Contributor Author

/azp run runtime-libraries-coreclr outerloop

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@antonfirsov

Copy link
Copy Markdown
Contributor Author

System.Runtime wasm failure is unrelated, outrloop pipeline seems to be broken.

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.

Socket.BeginConnect in .NET 6 throws an unobserved SocketException

4 participants