[PR #1041] [CLOSED] Fix multi-threading support to exclude split/multi-volume ZIP archives #1464

Closed
opened 2026-01-29 22:20:42 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/adamhathcock/sharpcompress/pull/1041
Author: @Copilot
Created: 11/27/2025
Status: Closed

Base: adam/multi-threadedHead: copilot/sub-pr-1040


📝 Commits (2)

  • 5776f7c Initial plan
  • c11277f Fix test failures for multi-threading support in file-based Zips

📊 Changes

3 files changed (+8 additions, -10 deletions)

View changed files

📝 src/SharpCompress/Common/Zip/SeekableZipFilePart.cs (+6 -8)
📝 tests/SharpCompress.Test/Tar/TarReaderAsyncTests.cs (+1 -1)
📝 tests/SharpCompress.Test/Tar/TarReaderTests.cs (+1 -1)

📄 Description

Multi-threading support was incorrectly enabling independent file streams for split ZIP archives, causing decompression failures when entry data spans multiple volumes.

Changes

  • SeekableZipFilePart: Check ss.Files.Count == 1 before opening independent file streams

    • CreateBaseStream(): Only create new FileStream for single-file archives
    • SupportsMultiThreading: Return false for split/multi-volume archives
  • Tar symlink tests: Fix build for .NET Framework 4.8 by changing #if LINUX to #if LINUX && !NETFRAMEWORK (Mono.Posix.NETStandard not available for NETFRAMEWORK)

// Before: broke split archives
public override bool SupportsMultiThreading => 
    BaseStream is SourceStream ss && ss.IsFileMode;

// After: only single-file archives support multi-threading
public override bool SupportsMultiThreading =>
    BaseStream is SourceStream ss && ss.IsFileMode && ss.Files.Count == 1;

Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/adamhathcock/sharpcompress/pull/1041 **Author:** [@Copilot](https://github.com/apps/copilot-swe-agent) **Created:** 11/27/2025 **Status:** ❌ Closed **Base:** `adam/multi-threaded` ← **Head:** `copilot/sub-pr-1040` --- ### 📝 Commits (2) - [`5776f7c`](https://github.com/adamhathcock/sharpcompress/commit/5776f7c1ff56a217182182423486363be80498db) Initial plan - [`c11277f`](https://github.com/adamhathcock/sharpcompress/commit/c11277fbefe861f3218fe57f43b13a6d15faf957) Fix test failures for multi-threading support in file-based Zips ### 📊 Changes **3 files changed** (+8 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `src/SharpCompress/Common/Zip/SeekableZipFilePart.cs` (+6 -8) 📝 `tests/SharpCompress.Test/Tar/TarReaderAsyncTests.cs` (+1 -1) 📝 `tests/SharpCompress.Test/Tar/TarReaderTests.cs` (+1 -1) </details> ### 📄 Description Multi-threading support was incorrectly enabling independent file streams for split ZIP archives, causing decompression failures when entry data spans multiple volumes. ## Changes - **SeekableZipFilePart**: Check `ss.Files.Count == 1` before opening independent file streams - `CreateBaseStream()`: Only create new FileStream for single-file archives - `SupportsMultiThreading`: Return false for split/multi-volume archives - **Tar symlink tests**: Fix build for .NET Framework 4.8 by changing `#if LINUX` to `#if LINUX && !NETFRAMEWORK` (Mono.Posix.NETStandard not available for NETFRAMEWORK) ```csharp // Before: broke split archives public override bool SupportsMultiThreading => BaseStream is SourceStream ss && ss.IsFileMode; // After: only single-file archives support multi-threading public override bool SupportsMultiThreading => BaseStream is SourceStream ss && ss.IsFileMode && ss.Files.Count == 1; ``` <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/adamhathcock/sharpcompress/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 22:20:42 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#1464