[release/6.0] Backport FileStream finalization fixes#80439
Merged
carlossanlop merged 4 commits intodotnet:release/6.0from Jan 11, 2023
Merged
[release/6.0] Backport FileStream finalization fixes#80439carlossanlop merged 4 commits intodotnet:release/6.0from
carlossanlop merged 4 commits intodotnet:release/6.0from
Conversation
…net#65899) * add missing GC.SuppressFinalize(this) to FileStream.DisposeAsync * DerivedFileStreamStrategy.DisposeAsync does not need to call _fileStream.BaseDisposeAsync, as FileStream.DisposeAsync calls Dispose(false) now
…that they are red
|
Tagging subscribers to this area: @dotnet/area-system-io |
jeffhandley
approved these changes
Jan 10, 2023
Member
jeffhandley
left a comment
There was a problem hiding this comment.
Looks good to me; thanks, @adamsitnik. We will await Tactics review.
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #64997 and #65899 to release/6.0
Customer Impact
Multiple users reported performance issues (#78553, #64741) caused by a lack of proper finalization suppression of the file stream buffering strategy. Users who create a lot of
FileStreaminstances (with buffering enabled, which is the default and can't not be controlled application-wide with a single flag) and dispose them properly suffer from having plenty of finalizable objects in the finalizer queue. It leads to performance degradation.Testing
Automated tests were added and they are passing. Additional local validation confirmed the leak is gone.
Risk
The risk is low. The fixes "matured" in main and were released as part of .NET 7 (last fix merged 10 months ago) .
fixes #78553