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

[release/7.0] TarReader should dispose underlying stream if leaveOpen is false #80598

Merged
merged 3 commits into from
Jan 13, 2023

Conversation

jozkee
Copy link
Member

@jozkee jozkee commented Jan 13, 2023

Backport of #79899, #79920, and #80572 to release/7.0

Details

We are not disposing the stream that is wrapped by TarReader even when specifically asked to dispose it with leaveOpen:false.

Customer Impact

This has a customer impact of potentially leaking resources without the user noticing it. as it manifested in our CI, #77012 shows how temporary files were piling up and out-of-disk-space errors happened due to the underlying FileStreams not being properly disposed.

Testing

Unit tests were added to verify that the underlying stream is properly disposed when the TarReader is disposed syncronously and asynchronously.

Risk

Low.

jozkee and others added 3 commits January 12, 2023 13:56
…#79920)

* Dispose underlying stream in TarReader.DisposeAsync() as well

Same as dotnet#79899

* Consolidate duplicated WrappedStream test helpers to Common sources

* Dispose stream passed to WrappedStream
* Dispose archive stream after the list of DataStreams

* Add tests for TarReader.DisposeAsync properly disposing underlying stream
@jozkee jozkee added the Servicing-consider Issue for next servicing release review label Jan 13, 2023
@jozkee jozkee added this to the 7.0.x milestone Jan 13, 2023
@jozkee jozkee self-assigned this Jan 13, 2023
@ghost
Copy link

ghost commented Jan 13, 2023

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

Issue Details

Backport of #79899, #79920, and #80572 to release/7.0

Details

We are not disposing the stream that is wrapped by TarReader even when specifically asked to dispose it with leaveOpen:false.

Customer Impact

This has a customer impact of potentially leaking resources without the user noticing it. as it manifested in our CI, #77012 shows how temporary files were piling up and out-of-disk-space errors happened due to the underlying FileStreams not being properly disposed.

Testing

Unit tests were added to verify that the underlying stream is properly disposed when the TarReader is disposed syncronously and asynchronously.

Risk

Low.

Author: Jozkee
Assignees: Jozkee
Labels:

Servicing-consider, area-System.IO

Milestone: 7.0.x

Copy link
Member

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

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

LGTM

@carlossanlop
Copy link
Member

CI failures are timeout cancellations in browser (unrelated to this change).

@carlossanlop carlossanlop modified the milestones: 7.0.x, 7.0.3 Jan 13, 2023
@carlossanlop carlossanlop added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Jan 13, 2023
@carlossanlop
Copy link
Member

Approved by Tactics via email (7.0.3).
Signed off by area owners.
No OOB changes needed for this assembly.
CI failures unrelated.
Ready to merge. :shipit:

@carlossanlop carlossanlop merged commit c8a73af into dotnet:release/7.0 Jan 13, 2023
@carlossanlop carlossanlop deleted the 7.0/tar_dispose branch January 13, 2023 21:01
@ghost ghost locked as resolved and limited conversation to collaborators Feb 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Formats.Tar Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants