Comment 5 for bug 1155092

Revision history for this message
Isaku Yamahata (yamahata) wrote :

Discussion moved from
https://bugs.launchpad.net/quantum/+bug/1158589

I suppose the issues is
- after failing to delete network namespace, the network namespace can't be used anymore.
  i.e. ip netns exec fails.
- And, later the network namespace with same name can't be created because it already exists.

How about not using lazy umount?
I.e. instead of executing ip netns delete, does the following in python
- umount(/var/run/netns/<NAME>) (without MNT_DETACH. not lazy umount)
  => may results in EBUSY. => error
- unlink(/var/run/netns/<NAME>)
  If umount above successed, this should success.

With this, although the network namespace might not be deleted, the network namespace can be reused later.
Ideally, ip netns should support this kind of operation. And the patch should be merged into the upstream of iproute2.
But for now we can use this as work around.