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: release the container resources if contaienr failed to start #1621

Conversation

shaloulcy
Copy link
Contributor

Signed-off-by: Eric Li lcy041536@gmail.com

Ⅰ. Describe what this PR did

When the container failed to start, we should release the container resources, including network and containerio.

Ⅱ. Does this pull request fix one issue?

NONE

Ⅲ. Describe how you did it

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

Signed-off-by: Eric Li <lcy041536@gmail.com>
@pouchrobot pouchrobot added kind/bug This is bug report for project size/XS labels Jul 4, 2018
@@ -444,6 +444,14 @@ func (mgr *ContainerManager) start(ctx context.Context, c *Container, detachKeys
if err == nil {
return
}

// release the container resources(network and containerio)
err = mgr.releaseContainerResources(c)
Copy link
Contributor

@HusterWan HusterWan Jul 4, 2018

Choose a reason for hiding this comment

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

if failed before prepareContainerNetwork, will always occur error here. WDTY??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, releaseContainerResources will still work. It will check the existence of network.

@codecov-io
Copy link

codecov-io commented Jul 4, 2018

Codecov Report

Merging #1621 into master will increase coverage by 0.05%.
The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1621      +/-   ##
==========================================
+ Coverage   41.96%   42.02%   +0.05%     
==========================================
  Files         270      270              
  Lines       17597    17603       +6     
==========================================
+ Hits         7385     7398      +13     
+ Misses       9303     9298       -5     
+ Partials      909      907       -2
Impacted Files Coverage Δ
daemon/mgr/container.go 50.54% <33.33%> (+0.19%) ⬆️
daemon/mgr/container_exec.go 67.77% <0%> (-2.34%) ⬇️
daemon/mgr/network.go 68.64% <0%> (+0.49%) ⬆️
daemon/logger/jsonfile/utils.go 73.17% <0%> (+1.62%) ⬆️
ctrd/image.go 79.42% <0%> (+2.85%) ⬆️

@HusterWan
Copy link
Contributor

lgtm

@pouchrobot pouchrobot added the LGTM one maintainer or community participant agrees to merge the pull reuqest. label Jul 6, 2018
@HusterWan HusterWan merged commit 3b435d9 into AliyunContainerService:master Jul 6, 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/XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants