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

bugfix: container cannot start after first start failed #1190

Merged

Conversation

HusterWan
Copy link
Contributor

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

@pouchrobot pouchrobot added kind/bug This is bug report for project size/S labels Apr 23, 2018
@HusterWan HusterWan force-pushed the zr/fix-start-failed branch from 586e70c to de9e32d Compare April 23, 2018 13:05
@pouchrobot pouchrobot added size/M and removed size/S labels Apr 23, 2018
@HusterWan HusterWan force-pushed the zr/fix-start-failed branch from de9e32d to 90cb4c4 Compare April 23, 2018 13:11
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())
Copy link
Collaborator

@allencloud allencloud Apr 23, 2018

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.

c.meta.State.ExitCode = 0

// set Snapshot MergedDir
c.meta.Snapshotter.Data["MergedDir"] = c.meta.BaseFS

c.Write(mgr.Store)
return err
Copy link
Collaborator

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?

@HusterWan HusterWan force-pushed the zr/fix-start-failed branch from 90cb4c4 to 0adb39f Compare April 23, 2018 13:33
c.meta.State.ExitCode = 0

// set Snapshot MergedDir
c.meta.Snapshotter.Data["MergedDir"] = c.meta.BaseFS

c.Write(mgr.Store)
Copy link
Contributor

@fuweid fuweid Apr 24, 2018

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)?

@allencloud and @HusterWan

Copy link
Collaborator

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>
@HusterWan HusterWan force-pushed the zr/fix-start-failed branch from 0adb39f to 3364441 Compare April 24, 2018 01:52
@pouchrobot
Copy link
Collaborator

ping @HusterWan

CI fails according integration system.
Please refer to the CI failure Details button to corresponding test, and update your PR to pass CI.

If this is flaky test, welcome to track this with profiling an issue.

build url: https://travis-ci.org/alibaba/pouch/builds/370377809
build duration: 180s

@HusterWan
Copy link
Contributor Author

LGTM

i will merge this pr to fix circle ci failed, if has any problem, feel free to contact me, thanks a lot

@allencloud @fuweid

@pouchrobot pouchrobot added the LGTM one maintainer or community participant agrees to merge the pull reuqest. label Apr 24, 2018
@HusterWan HusterWan merged commit 66b6396 into AliyunContainerService:master Apr 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug This is bug report for project LGTM one maintainer or community participant agrees to merge the pull reuqest. size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug]: cannot start after first start failed
4 participants