-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Conversation
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>
@@ -333,8 +333,10 @@ func (s *Supervisor) restore() error { | |||
continue | |||
} | |||
processes, err := container.Processes() |
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.
For now err
is always nil, can we ignore it here?
processes, _ := container.Processes()
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.
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.
LGTM |
1 similar comment
LGTM |
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>
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