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

S3 downloads are not interruptable #11678

Open
edolstra opened this issue Oct 11, 2024 · 5 comments · May be fixed by #12227
Open

S3 downloads are not interruptable #11678

edolstra opened this issue Oct 11, 2024 · 5 comments · May be fixed by #12227
Labels
bug fetching Networking with the outside (non-Nix) world, input locking good first issue Quick win for first-time contributors

Comments

@edolstra
Copy link
Member

Describe the bug

For instance, hitting Ctrl-C during

nix eval --impure --expr 'builtins.fetchurl "s3://highlighter-public/405b3ba02ccb2f07ec6aba9f233d4194.mp4?region=ap-southeast-2"'

does nothing.

Steps To Reproduce

Expected behavior

Nix should exit with error: interrupted by the user quickly.

Probably the easiest way to do this is to have S3Helper::getObject() use an std::stringstream wrapper that calls checkInterrupt().

nix-env --version output

Additional context

Add any other context about the problem here.

Priorities

Add 👍 to issues you find important.

@edolstra edolstra added bug good first issue Quick win for first-time contributors fetching Networking with the outside (non-Nix) world, input locking labels Oct 11, 2024
@KekmaTime
Copy link

@edolstra ill work on this issue if you can assign me this

@KekmaTime
Copy link

As a first-time contributor, I'd like some help. Where should I implement the new InterruptibleStringStream class (like in libutils or a specific folder)? Also, is this 👇🏽 where is the S3Helper is implemented ?

S3Helper::S3Helper(

@xokdvium
Copy link
Contributor

xokdvium commented Nov 8, 2024

I'm somewhat confused by the current implementation. Why does S3 fetching live inside curlFileTransfer, while having absolutely nothing to do with curl. The code is already littered with FIXME/TODO and the "easy" fix would pile even more complexity on this class. SRP is totally broken here. Maybe the better thing to do would be to define an abstract interface for fetching and move the code related to S3 into its own implementation?

@xokdvium
Copy link
Contributor

xokdvium commented Nov 8, 2024

Also S3 fetching is already problematic and it's not clear how it handles compressed streams? Does the AWS SDK handle the decompression (can it even do that?) or should it be handled the same way that it's done for regular HTTP with libarchive and TarArchive and Sinks/Sources? #11261

It would be very helpful to define interface boundaries so that there are clear and defined requirements and api for file transfers/stream decompression/progress tracking. This would be better in the long run than piling amazingly complex logic into a single class.

@RossComputerGuy RossComputerGuy linked a pull request Jan 10, 2025 that will close this issue
@RossComputerGuy
Copy link
Member

I've made an attempt in #12227, it's a little delayed at closing out but it does seem to improve the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fetching Networking with the outside (non-Nix) world, input locking good first issue Quick win for first-time contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants