Skip to content
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

nydus-snapshotter: fix recreate daemon config/socket dir #243

Merged
merged 1 commit into from
Dec 21, 2021

Conversation

luodw
Copy link
Collaborator

@luodw luodw commented Dec 20, 2021

when create multiple containers with same image, nydus-snapshotter will
create daemon config/socket dir per container, most of them can not be
deleted even though the image is deleted.

Signed-off-by: luodaowen.backend luodaowen.backend@bytedance.com

when create multiple containers with same image, nydus-snapshotter will
create daemon config/socket dir per container, most of them can not be
deleted even though the image is deleted.

Signed-off-by: luodaowen.backend <luodaowen.backend@bytedance.com>
Copy link
Member

@bergwolf bergwolf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change makes sense. But I'm wondering why containerd would ever delete an image when it is still referenced by some snapshots.

@bergwolf
Copy link
Member

Discussed with @luodw offline, so the issue is that when we create more containers with the same image in non-shared daemon mode, we would create extra directories in WithSocketDir and WithConfigDir etc., which is a side effect of failing fs.manager.NewDaemon(d). Defly a bug and need to be fixed.

@bergwolf
Copy link
Member

Thanks @luodw !

@bergwolf bergwolf merged commit d562c2d into dragonflyoss:master Dec 21, 2021
@@ -373,7 +377,10 @@ func (fs *filesystem) createSharedDaemon(snapshotID string, imageID string) (*da
d *daemon.Daemon
err error
)

d, _ = fs.manager.GetBySnapshotID(snapshotID)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though, seems it is also possible that a race window exists where two goroutines are creating daemons with those directories created.

@luodw luodw deleted the fix-recreate-dir branch December 23, 2021 03:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants