Skip to content

network veth interface leak in docker #1850

@moypray

Description

@moypray

Hi all,
When I run docker test in my local environment, the docker daemon would be killed while testing process, But after all the test stopped and stopped all the containers, I found that there are some network interfaces existing on host.

So I supposed there is network interface leak in docker. BTW, I use the bridge mode in docker.

After checking the libnetwork code, I found that if we killed docker after libnetwrok has created endpoint before saving it in blob, and the leak will be existing.

If we add time.Sleep(10*time.Second) before saving it to blob, after creating endpiont, it will be reproduced. e.g. add here: https://github.com/docker/libnetwork/blob/master/network.go#L1135

I have checked the libnetwork cleanup sandbox/network/endpoint mechanism. I think if we save the interface data into blob done, It won't leak at all.

So I wonder if we could update store first, and then create the endpoint ? Or any other good solution about this?

Thanks!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions