docker: support for requesting chunks without end offset#2391
docker: support for requesting chunks without end offset#2391mtrmac merged 1 commit intocontainers:mainfrom
Conversation
mtrmac
left a comment
There was a problem hiding this comment.
Thanks!
- How this is happening? I can’t see any c/storage caller setting this to -1 .
- The
Length == MaxUint64semantics is, AFAICS, not documented, and at leastmergeMissingChunksis doing ordinary arithmetic on the values. - If this should exist at all,
blobChunkAccessorProxy,splitHTTP200ResponseToPartial,streamChunksFromFiledo not handle the special case.
|
the error I am seeing is that we pass the value
the problem is here https://github.com/containers/storage/blob/main/pkg/chunked/storage_linux.go#L1611-L1617 in some cases the blobSize is set to -1 from c/image, e.g. when pulling I could change the code to not use any range (if there are no ranges, then request the whole file), but I thought this would be more flexible. We can restrict it so that only the last chunk can have len=-1 |
|
OK, so this is
Pedantically, when the size is unknown, while If you do want the conversion path to work on these images… yes, I think adding the “length unknown” case to But, at a higher level, this is really another argument to say that the transparent conversion should not be via |
we need to be able to pull via the |
|
As far as c/image is concerned, with One change that does make a difference, however, is that If this does help, arguably the layer extraction should be similarly made concurrent for non-chunked/non-ComposeFS layers as well. But that redesign would really be a very different conversation (and we might end up deprecating non-ComposeFS layers before that). |
679afe4 to
e09da45
Compare
|
I've tried adding a new method I've updated the comments |
mtrmac
left a comment
There was a problem hiding this comment.
Thanks. The existing code LGTM, but other parts need updating as well.
| } | ||
| var reader io.Reader | ||
| if c.Length == math.MaxUint64 { | ||
| reader = body |
There was a problem hiding this comment.
Non-blocking:
| reader = body | |
| reader = body // The caller has ensured that this is the last requested chunk |
e09da45 to
098926a
Compare
|
thanks, addressed your comments in the last version |
|
Seems like there is one comment by @mtrmac that was not addressed? |
I thought I've addressed them all, which one is still missing? |
if the specified length for the range is set to -1, then request all the data possible by using the "Range: <unit>=<range-start>-" syntax for the HTTP range. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
098926a to
b47707f
Compare
Thanks. Fixed now |
if the specified length for the range is set to -1, then request all the data possible by using the "Range: =-" syntax for the HTTP range.