Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/remotes/docker/fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ func (r dockerFetcher) open(ctx context.Context, req *request, mediatype string,
if err := r.Acquire(ctx, 1); err != nil {
return nil, err
}
resp, err := req.doWithRetries(ctx, lastHost, withErrorCheck, withOffsetCheck(offset))
resp, err := req.doWithRetries(ctx, lastHost, withErrorCheck, withOffsetCheck(offset, parallelism))
switch err {
case nil:
// all good
Expand Down
1 change: 1 addition & 0 deletions core/remotes/docker/fetcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ func TestFetcherOpenParallel(t *testing.T) {
sendContentLength = true

ignoreContentRange = true
checkReader(0)
checkReader(25)
ignoreContentRange = false

Expand Down
4 changes: 2 additions & 2 deletions core/remotes/docker/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -659,9 +659,9 @@ func withErrorCheck(r *request, resp *http.Response) error {

var errContentRangeIgnored = errors.New("content range requests ignored")

func withOffsetCheck(offset int64) doChecks {
func withOffsetCheck(offset, parallelism int64) doChecks {
return func(r *request, resp *http.Response) error {
if offset == 0 {
if parallelism <= 1 && offset == 0 {
return nil
}
if resp.StatusCode == http.StatusPartialContent {
Expand Down
Loading