Skip to content

Updater: No download progress hooks #1057

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

Closed
jku opened this issue Jun 26, 2020 · 4 comments
Closed

Updater: No download progress hooks #1057

jku opened this issue Jun 26, 2020 · 4 comments
Labels
client Related to the client (updater) implementation enhancement

Comments

@jku
Copy link
Member

jku commented Jun 26, 2020

Description of feature request:
For large downloads an interactive client would typically want to provide progress information (progress bar or just a running percentage or count of bytes). tuf.Updater could provide functionality that enables this.

The practical case I'm looking at is pip which currently uses the progress module while downloading chunks with requests module. If tuf support is added to pip, it will lose the progress indication functionality.

Current behavior:
The downloads are done in chunks already but there does not seem to be any way to add hooks into the download loop.

Expected behavior:
Updater could e.g. call an optional hook function with some progress data periodically. At a minimum the number of bytes downloaded so far should be available.

@lukpueh
Copy link
Member

lukpueh commented Jun 29, 2020

Thanks for the great feature request, @jku! Let me cross-reference with this general updater stack clean-up issue (#841) and another issue that touches the networking aspects (#932).

@jku
Copy link
Member Author

jku commented Jul 2, 2020

When/if this is fixed, the default download settings should be re-evaluated:

CHUNK_SIZE = 400000 #bytes
MIN_AVERAGE_DOWNLOAD_SPEED = 50 #bytes/second
SOCKET_TIMEOUT = 4 #seconds

A large download at 50b/sec seems to mean one progress update every two hours which would not be very interactive.

Of course the values also mean that a server sending a large file 1 b every 4 seconds would only get flagged as slow retrieval attack after 18 days of downloading... so maybe these values could be re-evaluated anyway.

Joshua pointed out #932 as related

@joshuagl joshuagl added this to the Refactor milestone Jul 7, 2020
@joshuagl joshuagl removed this from the Refactor milestone Sep 8, 2020
@jku
Copy link
Member Author

jku commented Nov 13, 2020

This would be deprecated with #1213 updater: abstract out the network IO

@jku jku added the client Related to the client (updater) implementation label Nov 27, 2020
@joshuagl
Copy link
Member

joshuagl commented Apr 7, 2021

Resolved obsolete by #1213

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Related to the client (updater) implementation enhancement
Projects
None yet
Development

No branches or pull requests

3 participants