-
Notifications
You must be signed in to change notification settings - Fork 384
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
docker: support for requesting chunks without end offset #2391
docker: support for requesting chunks without end offset #2391
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
- How this is happening? I can’t see any c/storage caller setting this to -1 .
- The
Length == MaxUint64
semantics is, AFAICS, not documented, and at leastmergeMissingChunks
is doing ordinary arithmetic on the values. - If this should exist at all,
blobChunkAccessorProxy
,splitHTTP200ResponseToPartial
,streamChunksFromFile
do 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. The existing code LGTM, but other parts need updating as well.
@@ -255,9 +256,15 @@ func splitHTTP200ResponseToPartial(streams chan io.ReadCloser, errs chan error, | |||
} | |||
currentOffset += toSkip | |||
} | |||
var reader io.Reader | |||
if c.Length == math.MaxUint64 { | |||
reader = body |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
098926a
to
b47707f
Compare
Thanks. Fixed now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
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.