Skip to content

Make sure containers are deleted correctly #225

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

Merged
merged 1 commit into from
Jul 24, 2019

Conversation

kzys
Copy link
Contributor

@kzys kzys commented Jul 17, 2019

Issue #, if available:

#65

Description of changes:

While we cannot repro #65 anymore, we'd like to have some tests to
prevent regression.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@kzys
Copy link
Contributor Author

kzys commented Jul 18, 2019

I initially thought that the issue itself has been resolved, but it seems not.

https://buildkite.com/firecracker-microvm/firecracker-containerd/builds/621#dca1dcc9-eb49-456e-9d4e-7d25a09fa268

failed to create VM dir bundle link: failed to create bundle symlink from "/var/run/firecracker-containerd/default/0/TestRemoveDir_Isolated-1563413455185085842"->"/run/containerd/io.containerd.runtime.v2.task/default/TestRemoveDir_Isolated-1563413455185085842": symlink /run/containerd/io.containerd.runtime.v2.task/default/TestRemoveDir_Isolated-1563413455185085842 /var/run/firecracker-containerd/default/0/TestRemoveDir_Isolated-1563413455185085842: file exists

@kzys
Copy link
Contributor Author

kzys commented Jul 18, 2019

Now I think our code was fine but the tests were wrong. Let's see. I'm going to work on the comments after CIs are being green.

@@ -319,6 +320,10 @@ func (s *service) StartShim(shimCtx context.Context, containerID, containerdBina
// task is deleted
containerCount = 1
exitAfterAllTasksDeleted = true

log.Infof("will start a single-task VM %s since no VMID has been provided", s.vmID)
Copy link
Contributor

Choose a reason for hiding this comment

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

Good idea to add these!

@kzys kzys force-pushed the fix-65 branch 4 times, most recently from 251278d to 68d2306 Compare July 23, 2019 01:03
@kzys
Copy link
Contributor Author

kzys commented Jul 23, 2019

All tests are passing finally!

Copy link
Contributor

@sipsma sipsma left a comment

Choose a reason for hiding this comment

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

One minor nit comment and I additionally think the commits should be squashed into 1 before merging, but otherwise looks good!


resp, err := s.taskManager.DeleteProcess(requestCtx, req, s.agentClient)
if err != nil {
return nil, err
}

if req.ExecID != "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I'd add a comment explaining why we skip deletion in this case

Before this change, we were only deleting the bundle directory on
the deletion of a VM. Due to that, we had symlink conflicts when

- We have multiple containers on a single VM
- The containers have the same name

Closes firecracker-microvm#65.

Signed-off-by: Kazuyoshi Kato <[email protected]>
Copy link
Contributor

@sipsma sipsma left a comment

Choose a reason for hiding this comment

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

LGTM!

@kzys kzys merged commit 2578f3d into firecracker-microvm:master Jul 24, 2019
fangn2 pushed a commit to fangn2/firecracker-containerd that referenced this pull request Mar 23, 2023
cni/cmd/tc-redirect-tap: fix dropped test error
fangn2 pushed a commit to fangn2/firecracker-containerd that referenced this pull request Mar 23, 2023
* Since firecracker-microvm/firecracker#2125, `cargo build` doesn't build jailer by default. (firecracker-microvm#263)
* Fix Benchmark Goroutine (firecracker-microvm#259)
* Jailer configuration API cleanup and improved logging with Debug log level (firecracker-microvm#255)
* Firecracker is internally has an instance ID, but the SDK didn't have the way to configure the ID. This change connects Config.VMID to the instance ID. (firecracker-microvm#253)
* Fixed error that was not being test against in `TestWait` (firecracker-microvm#251)
* Fixes issue where socket path may not be defined since the config file has yet to be loaded (firecracker-microvm#230)
* Fixed error that was not being test against in `TestNewPlugin` (firecracker-microvm#225)
* Download Firecracker 0.21.1 and its jailer from Makefile (firecracker-microvm#218)

Signed-off-by: xibz <[email protected]>
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.

3 participants