Close writable entry streams during async archive disposal - #1338
Merged
Conversation
Copilot
AI
changed the title
[WIP] Fix writable archive DisposeAsync to close entry streams
Close writable entry streams during async archive disposal
May 28, 2026
adamhathcock
approved these changes
May 28, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes async disposal for writable archives so entry streams tracked during async save flows are closed like the synchronous disposal path.
Changes:
- Adds
DisposeAsynccleanup inAbstractWritableArchivefor new, removed, and modified writable entries. - Adds async regression tests for Zip, Tar, and GZip writable archives to verify
closeStream: trueentry streams are disposed.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/SharpCompress/Archives/AbstractWritableArchive.Async.cs |
Adds async disposal cleanup for tracked writable archive entries. |
tests/SharpCompress.Test/Zip/ZipArchiveAsyncTests.cs |
Adds Zip async disposal regression coverage. |
tests/SharpCompress.Test/Tar/TarArchiveAsyncTests.cs |
Adds Tar async disposal regression coverage. |
tests/SharpCompress.Test/GZip/GZipArchiveAsyncTests.cs |
Adds GZip async disposal regression coverage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced May 29, 2026
github-actions Bot
pushed a commit
to Stella-sea/ryujinx-admin
that referenced
this pull request
May 31, 2026
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [SharpCompress](https://github.com/adamhathcock/sharpcompress) | `0.48.1` → `0.49.1` |  |  | --- ### Release Notes <details> <summary>adamhathcock/sharpcompress (SharpCompress)</summary> ### [`v0.49.1`](https://github.com/adamhathcock/sharpcompress/releases/tag/0.49.1): - More fixes [Compare Source](adamhathcock/sharpcompress@0.49.0...0.49.1) #### What's Changed - Close writable entry streams during async archive disposal by [@​Copilot](https://github.com/Copilot) in [#​1338](adamhathcock/sharpcompress#1338) - Restore `WriteToDirectoryAsync` progress callbacks for solid 7z archives by [@​Copilot](https://github.com/Copilot) in [#​1340](adamhathcock/sharpcompress#1340) - Try to fix global.json to avoid churn in locks by [@​adamhathcock](https://github.com/adamhathcock) in [#​1341](adamhathcock/sharpcompress#1341) - Fix tar archive enumeration after fully reading entry streams by [@​adamhathcock](https://github.com/adamhathcock) in [#​1342](adamhathcock/sharpcompress#1342) **Full Changelog**: <adamhathcock/sharpcompress@0.49.0...0.49.1> ### [`v0.49.0`](https://github.com/adamhathcock/sharpcompress/releases/tag/0.49.0): - Write Async fixes and more. [Compare Source](adamhathcock/sharpcompress@0.48.1...0.49.0) This should contain a lot of write async fixes and some breaking API changes that fix previous broke `net48` usage #### What's Changed - Rename IWriteableArchiveFactory.cs to IWritableArchiveFactory.cs by [@​Copilot](https://github.com/Copilot) in [#​1244](adamhathcock/sharpcompress#1244) - Some API clean up from GPT 5.4 by [@​adamhathcock](https://github.com/adamhathcock) in [#​1243](adamhathcock/sharpcompress#1243) - Release to master by [@​adamhathcock](https://github.com/adamhathcock) in [#​1267](adamhathcock/sharpcompress#1267) - Fix three BLAKE2sp correctness bugs and eliminate allocations in hot path by [@​coderb](https://github.com/coderb) in [#​1266](adamhathcock/sharpcompress#1266) - Corrected async examples. by [@​dlemstra](https://github.com/dlemstra) in [#​1277](adamhathcock/sharpcompress#1277) - Fix setting invalid access time fails extraction by [@​aromaa](https://github.com/aromaa) in [#​1279](adamhathcock/sharpcompress#1279) - Fix incorrect code examples in docs for sync/async usage by [@​Copilot](https://github.com/Copilot) in [#​1280](adamhathcock/sharpcompress#1280) - Replace APPNOTE.TXT contents with reference link note by [@​puk06](https://github.com/puk06) in [#​1286](adamhathcock/sharpcompress#1286) - Release to Master by [@​adamhathcock](https://github.com/adamhathcock) in [#​1274](adamhathcock/sharpcompress#1274) - update docs for tar gap analysis and XZ usage by [@​adamhathcock](https://github.com/adamhathcock) in [#​1288](adamhathcock/sharpcompress#1288) - Add a PooledMemoryStream to avoid allocating by [@​adamhathcock](https://github.com/adamhathcock) in [#​1275](adamhathcock/sharpcompress#1275) - fix: Change LeaveStreamOpen default from true to false by [@​puk06](https://github.com/puk06) in [#​1293](adamhathcock/sharpcompress#1293) - Fix usage of ReaderOptions and pre-defined values by [@​adamhathcock](https://github.com/adamhathcock) in [#​1295](adamhathcock/sharpcompress#1295) - Enforce seekable, readable and writable on streams by [@​adamhathcock](https://github.com/adamhathcock) in [#​1297](adamhathcock/sharpcompress#1297) - Add ArchiveInformation record for consolidated archive detection and capability inspection by [@​Copilot](https://github.com/Copilot) in [#​1299](adamhathcock/sharpcompress#1299) - merge release to master by [@​adamhathcock](https://github.com/adamhathcock) in [#​1314](adamhathcock/sharpcompress#1314) - Some clean up and test clean up by [@​adamhathcock](https://github.com/adamhathcock) in [#​1321](adamhathcock/sharpcompress#1321) - Finish Write Async by [@​adamhathcock](https://github.com/adamhathcock) in [#​1323](adamhathcock/sharpcompress#1323) - More complete Tar implementation: USTAR, PAX, etc. by [@​adamhathcock](https://github.com/adamhathcock) in [#​1289](adamhathcock/sharpcompress#1289) - Add Polysharp and adjustments that do not break legacy frameworks by [@​adamhathcock](https://github.com/adamhathcock) in [#​1330](adamhathcock/sharpcompress#1330) - Fix null `IVolume.FileName` for single-volume file-based archives by [@​Copilot](https://github.com/Copilot) in [#​1333](adamhathcock/sharpcompress#1333) - Add skills by [@​adamhathcock](https://github.com/adamhathcock) in [#​1332](adamhathcock/sharpcompress#1332) - add AOT smoke and missing tests by [@​adamhathcock](https://github.com/adamhathcock) in [#​1334](adamhathcock/sharpcompress#1334) #### New Contributors - [@​dlemstra](https://github.com/dlemstra) made their first contribution in [#​1277](adamhathcock/sharpcompress#1277) - [@​aromaa](https://github.com/aromaa) made their first contribution in [#​1279](adamhathcock/sharpcompress#1279) - [@​puk06](https://github.com/puk06) made their first contribution in [#​1286](adamhathcock/sharpcompress#1286) **Full Changelog**: <adamhathcock/sharpcompress@0.48.1...0.49.0> </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xNzguMCIsInVwZGF0ZWRJblZlciI6IjQzLjE3OC4wIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbXX0=--> Reviewed-on: https://git.ryujinx.app/projects/Ryubing/pulls/123
This was referenced May 31, 2026
Closed
This was referenced Jul 1, 2026
Merged
This was referenced Jul 10, 2026
This was referenced Jul 20, 2026
This was referenced Jul 27, 2026
This was referenced Aug 3, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
SaveToAsyncon writable archives completed without releasing tracked entry streams on async disposal, leaving output files/directories locked. The sync path already closed these streams; the async path now matches that behavior.Core fix (shared writable archive disposal path)
DisposeAsyncoverride inAbstractWritableArchive.Asyncto close tracked writable entries (newEntries,removedEntries,modifiedEntries) afterbase.DisposeAsync().Coverage across writable archive types
TarArchiveZipArchiveGZipArchivecloseStream: true, callsSaveToAsync, disposes asynchronously, and asserts the source stream is disposed.Behavioral parity (sync vs async)
Dispose(), preventing lingering file handles after async save flows.