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

Improve detection of HTTP "Range" requests in ConcurrentDownloadImage #141

Open
tri-adam opened this issue Apr 8, 2022 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@tri-adam
Copy link
Member

tri-adam commented Apr 8, 2022

The client supports parallel downloads using HTTP Range Requests. Currently, the client assumes ranged requests are supported if and only if the server performs a redirect via a http.StatusSeeOther. Otherwise, c.singleStreamDownload is utilized:

if res.StatusCode == http.StatusOK {
// Library endpoint does not provide HTTP redirection response, treat as single stream, direct download
c.Logger.Logf("Library endpoint does not support concurrent downloads; reverting to single stream")
return c.singleStreamDownload(ctx, dst, res, pb)
}

This negatively impacts download performance against servers that support ranged requests, but do not redirect via http.StatusSeeOther, and is the root cause of #129.

The current logic should be replaced with logic that detects HTTP range support in the standard fashion (ref).

@EmmEff
Copy link
Contributor

EmmEff commented Jan 24, 2023

This currently affects (only) Singularity Enterprise 2.0.x, which does not redirect on the /v1/imagefile endpoint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants