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

Switch to reqwest::blocking #44

Merged
merged 1 commit into from
Dec 21, 2023
Merged

Switch to reqwest::blocking #44

merged 1 commit into from
Dec 21, 2023

Conversation

pothos
Copy link
Member

@pothos pothos commented Dec 21, 2023

Seems to work :)

How to use

Agree if we want to use this

Testing done

Downloading with a direct URL and with the XML works. I also checked that the download is done to disk and there is no copy in RAM (/usr/bin/time -v shows the Maximum resident set size to be 24 MB for the full Flatcar update payload which is 370 MB).

@dongsupark
Copy link
Member

Can we please tokio and its dependencies, as they are not needed any more?

Copy link
Member

@dongsupark dongsupark left a comment

Choose a reason for hiding this comment

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

Anyway let's merge this change first.
Looks like it is needed for the client retry PR.

The use of async for the client was motivated by doing hashing while
downloading and ideally everything else too so it would extract to disk.
However, only the hashing was done and all other operations including
and additional hash step were done on the file.
Since the use of async brought more problems while not having a real
benefit, switch to a blocking mode. Instead of opening the file and
passing a write to the download function we now open the file inside
the download function which will make it easier to retry downloads.
@pothos
Copy link
Member Author

pothos commented Dec 21, 2023

Yes, have removed Tokio as direct dependency but it is still used by reqwest.

@pothos pothos merged commit 517b4ec into trunk Dec 21, 2023
1 check passed
@pothos pothos deleted the kai/noasync branch December 21, 2023 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants