-
Notifications
You must be signed in to change notification settings - Fork 365
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
Stale download cancellation #5025
Closed
Closed
Conversation
This file contains 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
16 tasks
kke
reviewed
Sep 23, 2024
This is a simple HTTP download function that can be used to download stuff from the Internet. Special care is taken to detect and sanitize server-suggested file names. Intended to replace the dependency on grab. Signed-off-by: Tom Wieczorek <twieczorek@mirantis.com>
Signed-off-by: Tom Wieczorek <twieczorek@mirantis.com>
It may very well be a local variable instead. Signed-off-by: Tom Wieczorek <twieczorek@mirantis.com>
This makes the download process use a temporary file and atomic file replacements on success. Allows existing files to be re-downloaded, which was not possible before. On the contrary, it will re-download files even if they didn't change. Signed-off-by: Tom Wieczorek <twieczorek@mirantis.com>
Returns a context that times out after a specified period of inactivity. It provides a "keep alive" mechanism to reset the timeout based on recent activity, ensuring that the context will remain valid for as long as there is activity. Signed-off-by: Tom Wieczorek <twieczorek@mirantis.com>
Moves the private implementation from the integration tests into the regular code base. This adapter is useful from time to time. Signed-off-by: Tom Wieczorek <twieczorek@mirantis.com>
Cancel downloads whenever there's no data flowing for a certain amount of time. Use k0scontext.WithInactivityTimeout for that. Signed-off-by: Tom Wieczorek <twieczorek@mirantis.com>
This will ensure that the download will fail at some point, even if the remote server is artificially slow. Signed-off-by: Tom Wieczorek <twieczorek@mirantis.com>
twz123
force-pushed
the
stale-download-cancellation
branch
from
September 23, 2024 13:29
1a51cce
to
356ac2f
Compare
This pull request has merge conflicts that need to be resolved. |
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.
Description
Cancel downloads whenever there's no data flowing for a certain amount of time. Add a very long overall timeout for Autopilot downloads. This will ensure that the download will fail at some point, even if the remote server is artificially slow.
Add
k0scontext.WithInactivityTimeout
, which returns a context that times out after a specified period of inactivity. It provides a "keep alive" mechanism to reset the timeout based on recent activity, ensuring that the context will remain valid for as long as there is activity. This is used to implement the cancellation of stale downloads.Move the private
writerFunc
implementation from the integration tests into the regular code base. This adapter is useful from time to time.Type of change
How Has This Been Tested?
Checklist: