Skip to content

daemon/containerd: some fixes and enhancements#46320

Merged
thaJeztah merged 3 commits intomoby:masterfrom
thaJeztah:c8d_log_release_fails
Aug 29, 2023
Merged

daemon/containerd: some fixes and enhancements#46320
thaJeztah merged 3 commits intomoby:masterfrom
thaJeztah:c8d_log_release_fails

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

daemon/containerd: log errors when releasing leases

Log a warning if we encounter an error when releasing leases. While it
may not have direct consequences, failing to release the lease should be
unexpected, so let's make them visible.

daemon/containerd: newROLayerForImage: remove unused args

Also rename variables that collided with imports.

daemon/containerd: rename some vars that collided with imports

- A picture of a cute animal (not mandatory but encouraged)

@thaJeztah thaJeztah added status/2-code-review area/images Image Service containerd-integration Issues and PRs related to containerd integration labels Aug 24, 2023
@thaJeztah thaJeztah added this to the 25.0.0 milestone Aug 24, 2023
Comment thread daemon/containerd/image_builder.go Outdated
}
defer done(ctx)
defer func() {
if err := release(ctx); err != nil && !cerrdefs.IsNotFound(err) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If we are going to log this then we shouldn't filter the not found error since this is something that shouldn't happen because this is a lease that we created

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good point, so I adopted this from some existing code that did the same. My assumption was that the existing code I found did this because these could theoretically be racy; the lease was created with leases.WithExpiration, which I assumed means it could be deleted out-of-band.

If that's the wrong assumption, I'll remove 😅 (let me know!)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah I would prefer if we logged them regardless of the error

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Alright; let me update 👍

Log a warning if we encounter an error when releasing leases. While it
may not have direct consequences, failing to release the lease should be
unexpected, so let's make them visible.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Also rename variables that collided with imports.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah force-pushed the c8d_log_release_fails branch from 1210b47 to e10eca3 Compare August 29, 2023 10:54
@thaJeztah
Copy link
Copy Markdown
Member Author

@rumpl updated; PTAL

Copy link
Copy Markdown
Member

@rumpl rumpl left a comment

Choose a reason for hiding this comment

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

❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/images Image Service containerd-integration Issues and PRs related to containerd integration process/cherry-picked status/2-code-review

Projects

Development

Successfully merging this pull request may close these issues.

2 participants