Skip to content

builder: ensure libnetwork state files do not leak#41863

Merged
cpuguy83 merged 1 commit into
moby:masterfrom
tonistiigi:net-leak-fix
Jan 8, 2021
Merged

builder: ensure libnetwork state files do not leak#41863
cpuguy83 merged 1 commit into
moby:masterfrom
tonistiigi:net-leak-fix

Conversation

@tonistiigi

Copy link
Copy Markdown
Member

Apparently calling sandbox.Delete is not enough to remove all the libnetwork state files, eg. the hosts and resolv.conf file. So to avoid leaks clean up the sandbox state directory manually.

Looking at what happens on regular containers, it seems that netns is cleaned up by finalized and not directly by code. This could be investigated more in the future as could leak on restarts etc. The hosts/resolv.conf is stored in container state directory and cleaned up with container afaics.

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

Comment thread builder/builder-next/executor_unix.go Outdated
Comment thread builder/builder-next/executor_unix.go Outdated

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks!

@thaJeztah

Copy link
Copy Markdown
Member

@cpuguy83 @tiborvass PTAL

@cpuguy83 cpuguy83 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@thaJeztah

Copy link
Copy Markdown
Member

Arf; cherry-picking this one, and notice that the PR description is only on GitHub, not as commit message 😞

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.

3 participants