pyroute2
pyroute2 copied to clipboard
"_get_ns_by_inode" can return error ENOENT if a namespace is delete during the function loop
"_get_ns_by_inode" can return an exception (ENOENT) if during the function loop, one of the namespaces listed in "listnetns" [1] is deleted. [2] will fail if the namespace does not exist at this time.
[1] https://github.com/svinota/pyroute2/blob/b25a6ca6c91da45cb5b54e7caffa1644fed2330d/pyroute2/netns/init.py#L153 [2] https://github.com/svinota/pyroute2/blob/b25a6ca6c91da45cb5b54e7caffa1644fed2330d/pyroute2/netns/init.py#L155
@ralonsoh having a minute pls review this change, could it be enough to close the issue: https://github.com/svinota/pyroute2/pull/969/files
Sorry for the delay.
I've manually applied this patch, reverting the Neutron's one, and seems to work.
I've also faked a long delay in between the namespace iteration (adding a sleep method) and I've manually deleted one of the listed namespaces. Now the method skips the deleted namespace.
I also works when "/var/run/nents" has not been created yet because no namespace has been created in this system since the last reboot.
Thanks!
Thanks!
@svinota so this issue can be closed now?
@pkulev I believe yes
Thanks for heads-up