Skip to content

Fix network interface leak issue#1851

Closed
moypray wants to merge 1 commit intomoby:masterfrom
moypray:leak
Closed

Fix network interface leak issue#1851
moypray wants to merge 1 commit intomoby:masterfrom
moypray:leak

Conversation

@moypray
Copy link
Copy Markdown

@moypray moypray commented Jul 24, 2017

Fix Issue: #1850

Description:
When the network resource(sandbox or interface) is created and not saved in store,
And docker got killed or crashed, there will be network resource leak.

Solution:
Save the resource to datastore first, then create the network resource.

Signed-off-by: Wentao Zhang zhangwentao234@huawei.com

@moypray
Copy link
Copy Markdown
Author

moypray commented Jul 25, 2017

I have updated the PR. could someone take a look?

Thanks~

@fcrisciani
Copy link
Copy Markdown

Hi @moypray looks like there is several failures in the CI

@moypray
Copy link
Copy Markdown
Author

moypray commented Jul 27, 2017

@fcrisciani Thanks for your reply,
But I am fresh for libnetwork project, I just update store before creating endpoints. Is there any desgin errors?

IThe CI error is

sandbox_test.go:103: driver failed programming external connectivity on endpoint ep1 (2203b1bdfae6544d0455ec03bf7d66ed923a09777019e38e9e8bb654f73eb337): failed to update bridge endpoint 2203b1b to store: failed to update bridge store for object type *bridge.bridgeEndpoint: Key not found in stor

@moypray moypray force-pushed the leak branch 3 times, most recently from 0a44ad3 to efed7e6 Compare July 28, 2017 07:39
@moypray
Copy link
Copy Markdown
Author

moypray commented Jul 28, 2017

@fcrisciani I have updated the PR, And all the CI passed.

Now I just add a update db operation before creating endpoints. I think it works but may be a little slower than before.

Description:
  When the network resource(sandbox or interface) is created and not saved in store,
  And docker got killed or crashed, there will be network resource leak.

Solution:
  Add a saving db operation before CreateEndpoint on host.

Signed-off-by: Wentao Zhang <zhangwentao234@huawei.com>
@vieux
Copy link
Copy Markdown
Contributor

vieux commented Aug 11, 2017

code LGTM

@vieux
Copy link
Copy Markdown
Contributor

vieux commented Aug 11, 2017

(not super familiar with the code though)

@moypray
Copy link
Copy Markdown
Author

moypray commented Aug 11, 2017

@vieux thanks for your reply,
This fix will update twice more db for bridge mode, and once more for other network plugin driver.
How does it affect the start time for containers? I could not answer it.

@thaJeztah
Copy link
Copy Markdown
Member

ping @selansen is this PR now redundant because #2024 was merged?

@fcrisciani fcrisciani closed this Jul 10, 2018
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