cmd/ctr: protect contents from GC#5692
Conversation
|
Build succeeded.
|
|
Build succeeded.
|
There was a problem hiding this comment.
simply defer done(ctx) is enough here and what is done in most places. If lease cleanup fails due to connection it will still get cleaned up later in the GC, if it fails in the backend the errors there will be more useful. Its not expected that a CLI user must act on a lease deletion failure though.
"ctr image import" didn't have a lease. Due to that, GC would remove contents during the import process. Fixes containerd#5690. Signed-off-by: Kazuyoshi Kato <[email protected]>
|
Build succeeded.
|
|
@kzys: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
| } | ||
| defer done(ctx) | ||
|
|
||
| imgs, err := client.Import(ctx, r, opts...) |
There was a problem hiding this comment.
The individual calls have it, I am curious if there is something getting garbage collected between import and unpack? Although I would expect if something was getting GC'ed before unpack, it would still end up getting GC'ed after
There was a problem hiding this comment.
Let me double-check the imported image. If it doesn't have any labels, it could be GC'd before Unpack.
AkihiroSuda
left a comment
There was a problem hiding this comment.
We seem to already have a lease
|
confirmation that there seems to be some issue with content and GC on |
|
This PR doesn't seem to fix the issue on Windows at least. |
|
So, I did some more investigation on this for a bit. There is a test ( And that layer gets "registered" with the content store, it is reachable with But people have reported issues with images that have multiple layers [1][2][3]. In And on the containerd logs we can see: Extending the lease to Looking through the containerd logs, it seems that the Garbage Collector deleted the I think that the Garbage Collector doesn't see those layers as visible ( [1] #5599 (comment) |
|
What I found is with regard to multiplatform images is the loader loads all blobs but only creates an image record for the default platform (stored on the client) unless |
|
So, I have found the problem for this issue, at least for the Windows side. So, someone commented that this didn't use to be a problem for containerd 1.4, but it started with containerd 1.5. Going through the containerd tags, it seems that this issue appeared between v1.5.0-rc.0 and v1.5.0-rc.1, more specifically, after this PR: #5298 That PR basically made the Windows' Tar images imported through This information is consistent with the information provided by @cpuguy83 . If I'm not sure how to address this issue. Ideally, the I wish this issue could have been caught early on Import, and not afterwards, after the operation "succeeded", when trying to use the image to spawn a container. I think it would be a good idea to have something like [1] [2] containerd/images/archive/importer.go Line 197 in af1a090 [3] Line 170 in af1a090 [4] Line 126 in af1a090 [5] #5916 [6] Line 240 in af1a090 |
Does it need to be this strict when OSVersion is missing? |
|
This PR wouldn't fix the issue as @claudiubelu said. |
"ctr image import" didn't have a lease. Due to that, GC would remove
contents during the import process.
Fixes #5690.
Signed-off-by: Kazuyoshi Kato [email protected]