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

Socket: don't disconnect Socket for unknown/unsupported socket options. #59925

Merged
merged 8 commits into from
Oct 8, 2021

Conversation

tmds
Copy link
Member

@tmds tmds commented Oct 4, 2021

Fixes #59055.

@antonfirsov @dotnet/ncl ptal.

@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Oct 4, 2021
@ghost
Copy link

ghost commented Oct 4, 2021

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

Issue Details

Fixes #59055.

@antonfirsov @dotnet/ncl ptal.

Author: tmds
Assignees: -
Labels:

area-System.Net.Sockets

Milestone: -

Copy link
Member

@antonfirsov antonfirsov left a comment

Choose a reason for hiding this comment

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

Thanks! I have only cosmetic concerns, otherwise looks good.

@tmds
Copy link
Member Author

tmds commented Oct 5, 2021

@antonfirsov can you take another look? I've addressed your feedback.

I've also made some additional changes. These have to do with us being able to detect use of an unknown option name (as ENOPROTOOPT), but not of an unknown option level. For the latter, the errno depends on the platform but is ambiguous (e.g. EINVAL can also mean the value is not valid).

We no longer disconnect for ENOPROTOOPT, but we keep disconnecting for the other errors (so also for unknown levels).

@tmds
Copy link
Member Author

tmds commented Oct 5, 2021

We no longer disconnect for ENOPROTOOPT, but we keep disconnecting for the other errors (so also for unknown levels).

Or alternatively, we could never disconnect?

Copy link
Member

@antonfirsov antonfirsov left a comment

Choose a reason for hiding this comment

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

The current changes look good.

We no longer disconnect for ENOPROTOOPT, but we keep disconnecting for the other errors (so also for unknown levels).

I see you reverted the attempt to fix this. Shall we merge this PR as-is, and maybe open a new issue to track/discuss possible enhancements?

@antonfirsov
Copy link
Member

/azp run runtime-libraries-coreclr outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@tmds
Copy link
Member Author

tmds commented Oct 8, 2021

Shall we merge this PR as-is, and maybe open a new issue to track/discuss possible enhancements?

Thanks @antonfirsov, this is good to merge.

The alternative is to never disconnect for socket option errors. We can consider it if someone asks for it. We don't need to create an issue now.

@antonfirsov
Copy link
Member

antonfirsov commented Oct 8, 2021

Test failures are unrelated, mostly #58355. @tmds thanks!

@antonfirsov antonfirsov merged commit edc5a41 into dotnet:main Oct 8, 2021
@karelz karelz added this to the 7.0.0 milestone Oct 14, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Nov 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Net.Sockets community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GetSocketOption/SetSocketOption should not close underlying socket
3 participants