Skip to content

libcontainerd: fix leaking container/exec state#35484

Merged
vdemeester merged 1 commit into
moby:masterfrom
tonistiigi:clear-state
Nov 14, 2017
Merged

libcontainerd: fix leaking container/exec state#35484
vdemeester merged 1 commit into
moby:masterfrom
tonistiigi:clear-state

Conversation

@tonistiigi
Copy link
Copy Markdown
Member

@tonistiigi tonistiigi commented Nov 13, 2017

@andrewhsu @dmcgowan @crosbymichael

Signed-off-by: Tonis Tiigi [email protected]

c.Lock()
delete(ctr.execs, ei.ProcessID)
c.Unlock()
ctr := c.getContainer(ei.ContainerID)
Copy link
Copy Markdown
Contributor

@mlaventure mlaventure Nov 14, 2017

Choose a reason for hiding this comment

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

On error (e.g. failure to create the task) this would cause a deadlock if I'm not mistaken

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Can you explain more? You mean the RLock inside getContainer() ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, I think I had this initially (a call to getContainer) and it caused a deadlock in some error conditions and for execs. Can't remember the exact details

Copy link
Copy Markdown
Member Author

@tonistiigi tonistiigi Nov 14, 2017

Choose a reason for hiding this comment

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

Well, it is taking the same lock as line 643 so I'm not sure how this can cause a deadlock and the previous one doesn't.

Copy link
Copy Markdown
Contributor

@mlaventure mlaventure Nov 14, 2017

Choose a reason for hiding this comment

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

I may just be confused, I'll have to have a closer look, I had to change this part quite a few time to get rid of all the deadlocks. I'll try to have a proper look sometime tomorrow.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just ignore me, this is safe 😇 I got confused with another part of the code.

Copy link
Copy Markdown
Contributor

@mlaventure mlaventure left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Member

@dmcgowan dmcgowan left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

LGTM 🐯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants