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

snapshot: use temporary lease during diffapply #2729

Merged
merged 2 commits into from
Mar 15, 2022

Conversation

sipsma
Copy link
Collaborator

@sipsma sipsma commented Mar 15, 2022

A temporary lease ctx was previously made during the snapshotter Merge
method but it was not passed to diffApply, which may have meant that
temporary View snapshots created there could be garbage collected by
containerd at any time.

It's possible this was encountered in CI, but I was unable to reproduce
the failure after 1000 attempts locally, so this commit is just a best
guess at the problem.

Signed-off-by: Erik Sipsma [email protected]

I can't be sure because I couldn't reproduce it but this is my best guess at the CI error @crazy-max pointed out here.

I also included a commit for a separate issue I noticed while fixing the main one:

cache: check that diff upper isn't nil
Before this, if you called DiskUsage when there was a Diff ref that had
a nil upper and that ref had not yet had a blob set, the
layerDigestChain method would get a nil pointer exception.

Signed-off-by: Erik Sipsma [email protected]

sipsma added 2 commits March 15, 2022 13:06
A temporary lease ctx was previously made during the snapshotter Merge
method but it was not passed to diffApply, which may have meant that
temporary View snapshots created there could be garbage collected by
containerd at any time.

It's possible this was encountered in CI, but I was unable to reproduce
the failure after 1000 attempts locally, so this commit is just a best
guess at the problem.

Signed-off-by: Erik Sipsma <[email protected]>
Before this, if you called DiskUsage when there was a Diff ref that had
a nil upper and that ref had not yet had a blob set, the
layerDigestChain method would get a nil pointer exception.

Signed-off-by: Erik Sipsma <[email protected]>
@sipsma sipsma requested a review from tonistiigi March 15, 2022 21:22
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.

2 participants