Skip to content
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

remove container stat dir when no process found in restore #828

Merged
merged 1 commit into from
May 10, 2017

Conversation

x1022as
Copy link

@x1022as x1022as commented May 10, 2017

Under some abnormal cases, container state dir exist while pid file not.
containerd restore would print this error to log without handling this,
it will set container state to stopped without removing its state dir.

trying to start the container again will cause error:
mkdir /var/run/docker/libcontainerd/containerd/xxx: file exists

Signed-off-by: Deng Guangxing dengguangxing@huawei.com

Under some abnormal cases, container state dir exist while pid file not.
containerd restore would print this error to log without handling this,
it will set container state to stopped without removing its state dir.

trying to start the container again will cause error:
`mkdir /var/run/docker/libcontainerd/containerd/xxx: file exists`

Signed-off-by: Deng Guangxing <dengguangxing@huawei.com>
@hqhq hqhq added the v0.2.x label May 10, 2017
@@ -333,8 +333,10 @@ func (s *Supervisor) restore() error {
continue
}
processes, err := container.Processes()
Copy link
Contributor

Choose a reason for hiding this comment

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

For now err is always nil, can we ignore it here?
processes, _ := container.Processes()

Copy link
Author

Choose a reason for hiding this comment

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

keep this error check here will do no harm, but I am happy to remove it because it's not in use. not sure if this error returned is a planned design.

@hqhq
Copy link
Contributor

hqhq commented May 10, 2017

LGTM

1 similar comment
@crosbymichael
Copy link
Member

LGTM

@crosbymichael crosbymichael merged commit 3addd84 into containerd:v0.2.x May 10, 2017
mlaventure added a commit to mlaventure/containerd that referenced this pull request Jul 7, 2017
This test that the daemon can restart if it was killed before all a process
state dir could be removed.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
crosbymichael added a commit that referenced this pull request Aug 2, 2017
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