Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

fix deadlock in ReleaseAllVms() #509

Merged
merged 1 commit into from
Jan 19, 2017
Merged

fix deadlock in ReleaseAllVms() #509

merged 1 commit into from
Jan 19, 2017

Conversation

laijs
Copy link
Contributor

@laijs laijs commented Jan 19, 2017

Foreach() holds the reader-lock for the podlist,
but p.Dissociate() reqired the writer-lock to remove the containers,
it results deadlock.

Signed-off-by: Lai Jiangshan jiangshanlai@gmail.com

for _, p := range remains {
glog.V(1).Infof("try to dissociate %s", p.Id())
if err := p.Dissociate(); err != nil {
glog.V(1).Infof("fail to dissociate %s: %v", p.Id(), err)
Copy link
Contributor

Choose a reason for hiding this comment

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

log as warning instead of info?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

for _, p := range remains {
glog.V(1).Infof("try to dissociate %s", p.Id())
if err := p.Dissociate(); err != nil {
glog.V(1).Warningf("fail to dissociate %s: %v", p.Id(), err)
Copy link
Contributor

Choose a reason for hiding this comment

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

glog.Warningf

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed again

Foreach() holds the reader-lock for the podlist,
but p.Dissociate() reqired the writer-lock to remove the containers,
it results deadlock.

Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
@feiskyer feiskyer merged commit 7ed0925 into hyperhq:master Jan 19, 2017
@laijs laijs deleted the deadlock branch June 21, 2017 06:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants