-
Notifications
You must be signed in to change notification settings - Fork 950
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
bugfix: container cannot start after first start failed #1190
bugfix: container cannot start after first start failed #1190
Conversation
586e70c
to
de9e32d
Compare
de9e32d
to
90cb4c4
Compare
daemon/mgr/container.go
Outdated
c.meta.State.StartedAt = time.Now().UTC().Format(utils.TimeLayout) | ||
pid, err := mgr.Client.ContainerPID(ctx, c.ID()) | ||
if err != nil { | ||
return errors.Wrapf(err, "failed to get PID of container: %s", c.ID()) |
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.
please remove :
in message, since it will be failed to get PID of container: xxxxxx: khljk
not so readable.
daemon/mgr/container.go
Outdated
c.meta.State.ExitCode = 0 | ||
|
||
// set Snapshot MergedDir | ||
c.meta.Snapshotter.Data["MergedDir"] = c.meta.BaseFS | ||
|
||
c.Write(mgr.Store) | ||
return err |
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.
return nil
is better, right?
90cb4c4
to
0adb39f
Compare
daemon/mgr/container.go
Outdated
c.meta.State.ExitCode = 0 | ||
|
||
// set Snapshot MergedDir | ||
c.meta.Snapshotter.Data["MergedDir"] = c.meta.BaseFS | ||
|
||
c.Write(mgr.Store) |
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.
since the c.Write
may return the error, how about return c.Write(mgr.Store)
?
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.
Totally agree with you. @fuweid @HusterWan
Signed-off-by: Michael Wan <zirenwan@gmail.com>
0adb39f
to
3364441
Compare
ping @HusterWan CI fails according integration system. If this is flaky test, welcome to track this with profiling an issue. build url: https://travis-ci.org/alibaba/pouch/builds/370377809 |
LGTM i will merge this pr to fix circle ci failed, if has any problem, feel free to contact me, thanks a lot |
Signed-off-by: Michael Wan zirenwan@gmail.com
Ⅰ. Describe what this PR did
Fix container start failed problem: if start failed once, all start action will fail because of network endpoint not deleted.
Ⅱ. Does this pull request fix one issue?
fixes #1068
Ⅲ. Describe how you did it
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews