libstore/filetransfer: Pause transfers instead of stalling the download thread#14614
Merged
Ericson2314 merged 5 commits intomasterfrom Nov 22, 2025
Merged
libstore/filetransfer: Pause transfers instead of stalling the download thread#14614Ericson2314 merged 5 commits intomasterfrom
Ericson2314 merged 5 commits intomasterfrom
Conversation
Those can never be nullptr, so we should use the type system to ensure this invariant.
This is necessary to make pausing/unpausing possible in a follow-up commit.
…ad thread Instead of naively stalling the download thread we can instead stop the transfer. This allows the other multiplexed connections to continue downloading (and unpacking), if the result of the download gets piped into a GitFileSystemObjectSink. Prior art in lix project: - https://git.lix.systems/lix-project/lix/commit/4ae6fb5a8f0d456b8d2ba2aaca3712b4e49057fc - https://git.lix.systems/lix-project/lix/commit/12156d3beb8a16c0e2e8cf7180e1fbf27280a669 This patch is very different from the lix one, since we are using a decompression sink in the middle of the pipeline but the co-authored-by is there since I was motivated to implement this by looking at the lix side of things. Co-authored-by: eldritch horrors <pennae@lix.systems>
Since the root cause (the lack of backpressure control) has been fixed in the previous commit we can revert the change from 8ffea0a and make the default size much smaller.
cd8b607 to
be28ad9
Compare
Contributor
Author
|
Needs more testing before merge, but I'm relatively confident this patch is good. |
Ericson2314
approved these changes
Nov 22, 2025
Member
|
Thanks for working in this! Does that mean that everyone who increased download-buffer-size should/can remove this once this change lands in their system? |
Contributor
Author
Yes, that is no longer necessary. I've also decreased the default so as to not waste memory. There's no benefit to having a big buffer now. |
Merged
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.
Motivation
Instead of naively stalling the download thread we can instead stop the transfer.
This allows the other multiplexed connections to continue downloading (and unpacking),
if the result of the download gets piped into a GitFileSystemObjectSink.
Prior art in lix project:
This patch is very different from the lix one, since we are using a decompression sink
in the middle of the pipeline but the co-authored-by is there since I was motivated to
implement this by looking at the lix side of things.
Co-authored-by: eldritch horrors pennae@lix.systems
Context
Resolves #11728
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.