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

improve SslStream exception after disposal #79329

Merged
merged 6 commits into from Jan 6, 2023
Merged

improve SslStream exception after disposal #79329

merged 6 commits into from Jan 6, 2023

Conversation

wfurt
Copy link
Member

@wfurt wfurt commented Dec 7, 2022

As noted in #78586, CloseInternal (e.g. Disose) can set _nestedRead to 1 and then we can throw misleading exception on next Read(Async). There are some checks in place but this seems to be race condition - I was not able to write reliable functional test for it.
This change basically splits the value so we can reliably determine when it was set by disposal.

Note that repro provided by @mikeharder still fails occasionally. That means that either HttpClient or Azure.Core.Pipeline does concurrent reads and that is not permitted by SslStream.
Investigating that is separate from the misleading exception.

closes #32577

@ghost
Copy link

ghost commented Dec 7, 2022

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

Issue Details

As noted in #78586, CloseInternal (e.g. Disose) can set _nestedRead to 1 and then we can throw misleading exception on next Read(Async). There are some checks in place but this seems to be race condition - I was not able to write reliable functional test for it.
This change basically splits the value so we can reliably determine when it was set by disposal.

Note that repro provided by @mikeharder still fails occasionally. That means that either HttpClient or Azure.Core.Pipeline does concurrent reads and that is not permitted by SslStream.
Investigating that is separate from the misleading exception.

closes #32577

Author: wfurt
Assignees: wfurt
Labels:

area-System.Net.Security

Milestone: -

@build-analysis build-analysis bot mentioned this pull request Dec 22, 2022
@wfurt
Copy link
Member Author

wfurt commented Jan 6, 2023

test failures is #80169.

@wfurt wfurt merged commit 2a27452 into dotnet:main Jan 6, 2023
@wfurt wfurt deleted the ode branch January 6, 2023 05:27
@ghost ghost locked as resolved and limited conversation to collaborators Feb 5, 2023
@karelz karelz added this to the 8.0.0 milestone Mar 22, 2023
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.

[System.IO.Compression] ZipArchive copies Stream to MemoryStream
5 participants