Skip to content

[20.10 backport] builder: ensure libnetwork state file do not leak#41972

Merged
tiborvass merged 1 commit into
moby:20.10from
thaJeztah:20.10_backport_net_leak_fix
Feb 18, 2021
Merged

[20.10 backport] builder: ensure libnetwork state file do not leak#41972
tiborvass merged 1 commit into
moby:20.10from
thaJeztah:20.10_backport_net_leak_fix

Conversation

@thaJeztah

Copy link
Copy Markdown
Member

backport of #41863

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.

Cherry-pick was not clean, but only a minor issue; same (but reverse) as #41965 (comment)

@thaJeztah thaJeztah added this to the 20.10.4 milestone Feb 3, 2021
@thaJeztah
thaJeztah requested a review from tonistiigi as a code owner February 3, 2021 13:08
@thaJeztah

Copy link
Copy Markdown
Member Author

@tonistiigi @AkihiroSuda ptal

Signed-off-by: Tonis Tiigi <[email protected]>
(cherry picked from commit 7c7e168)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah
thaJeztah force-pushed the 20.10_backport_net_leak_fix branch from 969632b to e375035 Compare February 17, 2021 20:21
@thaJeztah

Copy link
Copy Markdown
Member Author

rebased to trigger CI with test-fixes that were merged

@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

@tiborvass
tiborvass merged commit 6a86c25 into moby:20.10 Feb 18, 2021
@thaJeztah
thaJeztah deleted the 20.10_backport_net_leak_fix branch February 18, 2021 21:26
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.

4 participants