Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Ignore docker source cleanup err when resource not found #588

Merged
merged 1 commit into from
Apr 20, 2020

Conversation

darkowlzz
Copy link
Contributor

@darkowlzz darkowlzz commented Apr 19, 2020

Fixes the snapshot not found error seen in the CI when importing VM,
kernel images and running a VM for the first time. The issue was due to
a missing containerd snapshot key which was attempted to be cleaned up.
Since the snapshot key didn't exist, the cleanup returned snapshot <key> does not exist: not found error.
The fix checks if the error is a containerd "not found" error and
ignores it. Any other error during the cleanup is returned as before.

containerd cleanup function:

cleanup = func() (err error) {
defer util.DeferErr(&err, snapshotter.Close)
defer util.DeferErr(&err, func() error { return snapshotter.Remove(cc.ctx, viewKey) })
defer util.DeferErr(&err, func() error { return mount.UnmountAll(dir, 0) })
defer util.DeferErr(&err, tarCmd.Wait)
return
}

In case of docker, the cleanup removes a container.

Link to a CI build with debug logs: https://travis-ci.com/github/darkowlzz/ignite/builds/160924846#L529

It's possible that we are seeing this due to the containerd dependency update from 1.3.0 to 1.3.3, or maybe this issue always existed.

Fixes the snapshot not found error seen in CI when importing VM and
kernel images and running a VM for the first time. The issue was due to
a missing containerd snapshot key which was attempted to be cleaned up.
Since the snapshot key didn't exist, the cleanup returned `snapshot <id>
does not exist: not found` error.
The fix checks if the error is a containerd "not found" error and
ignores it. Any other error during the cleanup is returned as before.
@darkowlzz darkowlzz requested a review from twelho as a code owner April 19, 2020 20:13
@stealthybox stealthybox merged commit 81b7abe into weaveworks:master Apr 20, 2020
@luxas luxas added this to the v0.7.0 milestone Jun 2, 2020
@darkowlzz darkowlzz deleted the snapshot-not-found-error branch June 8, 2020 18:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants