-
Notifications
You must be signed in to change notification settings - Fork 347
Conversation
|
I tested the PR with On the client side: On the server side: |
mikebrow
left a comment
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.
LGTM
| if err != nil { | ||
| return "", "", fmt.Errorf("failed to fetch image %q desc %+v: %v", ref, desc, err) | ||
| // Dispatch returns error when requested resources are locked. | ||
| // In that case, we should start waiting and checking the pulling |
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.
so they are not always sync calls... :-) This explains some of the errors I was seeing... that the concurrent request may not be finished yet thus the locked resource!
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.
Sort of wish they would block themselves.. but ok this works.
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.
@mikebrow so they are not always sync calls... :-) This explains some of the errors I was seeing... that the concurrent request may not be finished yet thus the locked resource!
The first call will be a sync call. The problem is that the second call returns immediately with error because someone else holds the lock of the resource. :)
bf3fae0 to
49003c9
Compare
49003c9 to
d076706
Compare
yujuhong
left a comment
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.
Looks good with a question
pkg/server/image_pull.go
Outdated
| } | ||
|
|
||
| // waitDownloadingInterval is the interval to check resource downloading progress. | ||
| const waitDownloadingInterval = 200 * time.Millisecond |
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.
nit: waitDownloadingPollInterval might be better
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.
Will do
pkg/server/image_pull.go
Outdated
| if err := c.waitForResourcesDownloading(ctx, resources.all()); err != nil { | ||
| return "", "", fmt.Errorf("failed to wait for image %q downloading: %v", ref, err) | ||
| } | ||
| glog.V(4).Infof("Finish downloading resources for image %q", ref) |
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.
s/Finish/Finished
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.
Will do
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.
Done.
|
|
||
| // Unpack the image layers into snapshots. | ||
| if _, err = c.rootfsUnpacker.Unpack(ctx, manifest.Layers); err != nil { | ||
| rootfsUnpacker := rootfsservice.NewUnpackerFromClient(c.rootfsService) |
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.
Why using a new unpacker?
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.
Because in following PRs, we'll start to use rootfsService more, instead of only the Unpacker.
So I change the rootfsService to be a field of criContainerdService, and new a unpacker when we need it. The unpacker is only needed in this function.
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.
Ack.
|
The rest is just minor nits. Feel free to apply the lgtm label and merge the PR after you update it. |
Signed-off-by: Random-Liu <[email protected]>
Signed-off-by: Random-Liu <[email protected]>
d076706 to
c3ac5f7
Compare
|
Apply LGTM based on #46 (review) and #46 (review). |
Wait and check image pulling progress.
Don't panic when processing nil stats
Based on #41.
This PR:
Statusfunction in content api./cc @yujuhong @mikebrow