Skip to content

Add lease and remove special case#2405

Merged
AkihiroSuda merged 3 commits intocontainerd:mainfrom
gabriel-samfira:add-lease
Aug 2, 2023
Merged

Add lease and remove special case#2405
AkihiroSuda merged 3 commits intocontainerd:mainfrom
gabriel-samfira:add-lease

Conversation

@gabriel-samfira
Copy link
Copy Markdown
Contributor

This change adds a lease to the view creation. Without a lease, there is a high probability that the newly created view will be removed by the containerd garbage collector shortly after we create the view and before we get a chance to use it.

Depending on when the GC runs during the call to m.Mount(), we may get a set of different errors (at least on Windows) ranging from The system cannot find the path specified to The parameter is incorrect to Access is denied.

Adding a lease prevents containerd from removing the view mid-flight.

This change also adds a drive-by fix. The special case for Windows when mounting the view, was removed.

Fixes containerd/containerd#8891

Without adding a lease, the containerd GC will remove the view we just
created, while we're attempting to use it, leading to the Mount()
function erring out.

The lease ensures that the view will not be reaped prematurely.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
@gabriel-samfira
Copy link
Copy Markdown
Contributor Author

CC: @AkihiroSuda

@gabriel-samfira
Copy link
Copy Markdown
Contributor Author

The failure seems to be in TestStart. That seems to be a bug unrelated to the snapshotter issue.

@gabriel-samfira
Copy link
Copy Markdown
Contributor Author

The TestStart fail seems to only happen on ltsc2019

@AkihiroSuda
Copy link
Copy Markdown
Member

Thank you, could you try running CI with containerd v1.7.3?

ctrdVersion: 1.7.1

@AkihiroSuda AkihiroSuda added this to the v1.5.1 (tentative) milestone Aug 1, 2023
@AkihiroSuda AkihiroSuda added the platform/Windows/Non-WSL2 Microsoft Windows (non-WSL2) label Aug 1, 2023
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
@gabriel-samfira
Copy link
Copy Markdown
Contributor Author

gabriel-samfira commented Aug 1, 2023

CI seems happy on 1.7.3

edit: Well, at least the Windows CI 😄 . The failures do not seem related to this change.

// When the Unmount fails, RemoveAll will incorrectly delete data from the mounted dir
defer os.Remove(tempDir)

// Add a lease of 1 hour to the view so that it is not garbage collected
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@AkihiroSuda I added a 1 hour lease. Let me know if you prefer a different value.

Copy link
Copy Markdown
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

Thanks

@AkihiroSuda AkihiroSuda merged commit 2eeffe0 into containerd:main Aug 2, 2023
@AkihiroSuda
Copy link
Copy Markdown
Member

@gabriel-samfira
Copy link
Copy Markdown
Contributor Author

I don't think it was triggered by this change. It seems to be a networking issue, which I have seen on ltsc2019, but does not happen on ltsc2022. Does the CI also run on ltsc2022? Are you seeing it there as well?

@AkihiroSuda
Copy link
Copy Markdown
Member

Currently the Cirrus CI only runs on "windows-2019-core-for-containers"
https://github.com/cirruslabs/vm-images/blob/master/googlecompute/windows_images.json

Maybe we should migrate to GitHub Actions?

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

Labels

platform/Windows/Non-WSL2 Microsoft Windows (non-WSL2)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Windows] containerd >= 1.7.2 can't pass nerdctl CI: hcsshim::PrepareLayer failed in Win32: The parameter is incorrect. (0x57)

2 participants