-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
cleanup/fix integration-cli for overlay in overlay #12206
Conversation
changed https://jenkins.dockerproject.com/job/Docker%20Master%20(overlay%20on%20overlay)/290/console to build from my branch as proof |
dammit, worked on my machine, there is a more annoying problem from these "Dead" containers |
back to the drawing board |
oooo i know |
52453c4
to
cb9b8db
Compare
if err != nil || exitCode != 0 { | ||
t.Fatal("failed to create a container", out, err) | ||
} | ||
|
||
cleanedContainerID := strings.TrimSpace(out) | ||
defer deleteContainer(cleanedContainerID) | ||
defer dockerCmd(t, "rm", "-f", cleanedContainerID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the test that was creating the "Dead" container, and this is the fix
Signed-off-by: Jessica Frazelle <jess@docker.com>
cb9b8db
to
255b844
Compare
@@ -472,7 +472,7 @@ func TestCpVolumePath(t *testing.T) { | |||
} | |||
|
|||
cleanedContainerID := strings.TrimSpace(out) | |||
defer deleteContainer(cleanedContainerID) | |||
defer dockerCmd(t, "rm", "-fv", cleanedContainerID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the test that was creating the "Dead" container, and this is the fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its gotta be something with creating the volume via vfs in overlay in overlay that makes the container need a SIGTERM and SIGKILL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but -f
is always doing a sigkill, and isn't deleteContainer
doing this exact thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is the super intricate difference of doing a SIGTERM, then SIGKILL that is different and somehow saves the day
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, I know why!
Dead containers happen when rm
failed, but when you rm -f
them again it forcibly removes them from docker regardless if there is an issue.
So first time with rm -f
it had an issue, is marked as dead. If you just rm
(no -f
) it won't remove if the issue isn't resolved. But when you rm -f
again, it will remove from docker regardless of issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-f calls container.Stop(3)
which does the TERM & KILL after 3 seconds, deleteContainer does just a SIGKILL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but what it is causing the 2nd one to work isn't the TERM vs KILL, it's that -f
has tells Docker to actually remove a container that is in a dead
state no matter what.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh damn you were better than me, and i went into the depths of the sigs :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but i am only calling rm -f
once not twice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deleteContainers does just a kill and rm
https://jenkins.dockerproject.com/job/Docker%20Master%20(overlay%20on%20overlay)/293/console EDIT: it failed on something unrelated because of a dev device but fixed here https://jenkins.dockerproject.com/job/Docker%20Master%20(overlay%20on%20overlay)/294/console /me cannot catch a break |
@@ -3449,7 +3450,8 @@ func TestRunContainerWithRmFlagExitCodeNotEqualToZero(t *testing.T) { | |||
func TestRunContainerWithRmFlagCannotStartContainer(t *testing.T) { | |||
defer deleteAllContainers() | |||
|
|||
runCmd := exec.Command(dockerBinary, "run", "--rm", "busybox", "commandNotFound") | |||
name := "sparkles" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sunshine! Sparkle!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😎 ya kinda left over from debuigging but i like
LGTM |
1 similar comment
LGTM |
cleanup/fix integration-cli for overlay in overlay
closes #11966