Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Conversation

@Random-Liu
Copy link
Member

sandbox_stop.go should only kill the sandbox container, and event monitor will handle TaskExit event and Delete the task.

Errors caused by this race condition:

time="2018-04-18T00:53:09Z" level=error msg="Failed to handle event &TaskExit{ContainerID:e162c2c3f61deeebc88a9f12219fc574eb2b3a47a5bd9d0e1a79f2fc643a37c4,ID:e162c2c3f61deeebc88a9f12219fc574eb2b3a47a5bd9d0e1a79f2fc643a37c4,Pid:21642,ExitStatus:137,ExitedAt:2018-04-18 00:53:09.292640191 +0000 UTC,} for container e162c2c3f61deeebc88a9f12219fc574eb2b3a47a5bd9d0e1a79f2fc643a37c4" error="failed to handle sandbox TaskExit event: failed to stop sandbox: container must be created: failed precondition"

Signed-off-by: Lantao Liu [email protected]

@Random-Liu Random-Liu added this to the v1.0.0 milestone Apr 18, 2018
Copy link
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

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

see nits


// Delete the sandbox container from containerd.
_, err = task.Delete(ctx, containerd.WithProcessKill)
// Kill the sanbox container.
Copy link
Member

Choose a reason for hiding this comment

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

/s/san/sand/

Copy link
Member

Choose a reason for hiding this comment

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

Please update function comment on line 98 to:
// stopSandboxContainer kills the sandbox container.
// note: task.Delete is not called here because it will be called when the event monitor handles the TaskExit event

Copy link
Member Author

Choose a reason for hiding this comment

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

Will do.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@Random-Liu Random-Liu force-pushed the fix-sandbox-stop-race branch from cbc29ff to 856534c Compare April 18, 2018 17:12
Copy link
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

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

/LGTM

@Random-Liu Random-Liu merged commit daa9f60 into containerd:master Apr 18, 2018
@Random-Liu Random-Liu deleted the fix-sandbox-stop-race branch April 18, 2018 20:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants