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

Fix veth leak in overlay driver #995

Merged
merged 1 commit into from
Mar 8, 2016
Merged

Fix veth leak in overlay driver #995

merged 1 commit into from
Mar 8, 2016

Conversation

aboch
Copy link
Contributor

@aboch aboch commented Mar 7, 2016

  • Because of the lazy logic in Leave(), the overlay
    veth end is not moved from the sandbox to the host
    network namspace until the last endpoint leaves.
    We cannot rely on this logic to clear the veth pairs,
    because on last endpoint leave we have no reference to
    the other N-1 veth names.
  • The fix is to delete the container veth end on endpoint delete.
    This anyways deletes both veth ends, regardless they are in different
    namespaces.

Note: I'd be happy to remove the code at https://github.com/docker/libnetwork/blob/master/drivers/overlay/ov_network.go#L173
as it is no longer needed.
[That cannot be removed as it was not intended to handle the veth pairs that connect to the container sandbox]

Fixes #984

Signed-off-by: Alessandro Boch aboch@docker.com

- Because of the lazy logic in Leave(), the overlay
  veth end is not moved from the sandbox to the host
  network namspace until the last endpoint leaves.
  We cannot rely on this logic to clear the veth pairs,
  because on last endpoint leave we have no reference to
  the other N-1 veth names.

- The fix is to delete the container veth end on endpoint delete.
  This anyways deletes both veth ends, regardless they are in different
  namespaces.

Signed-off-by: Alessandro Boch <aboch@docker.com>
@mrjana
Copy link
Contributor

mrjana commented Mar 8, 2016

LGTM

1 similar comment
@mavenugo
Copy link
Contributor

mavenugo commented Mar 8, 2016

LGTM

mavenugo added a commit that referenced this pull request Mar 8, 2016
Fix veth leak in overlay driver
@mavenugo mavenugo merged commit 5594145 into moby:master Mar 8, 2016
@aboch aboch deleted the vcu branch March 9, 2016 17:50
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.

Overlay driver appears to be leaking veth devices
4 participants