snapshot: use temporary lease during diffapply #2729
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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]