Public bug reported: Here's a simplification of 'get_free_namespace_port':
output = ip_wrapper.netns.execute(['ss', param]) used_ports = _get_source_ports_from_ss_output(output) # Parses 'ss' output and gets all used ports, this is the problematic part return get_unused_port(used_ports) Here's a demonstration: output = ip_wrapper.netns.execute(['ss', param]) print output State Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 10 127.0.0.1:6640 *:* LISTEN 0 128 *:46675 *:* LISTEN 0 128 *:22 *:* LISTEN 0 128 *:5432 *:* LISTEN 0 128 *:3260 *:* LISTEN 0 50 *:3306 *:* ESTAB 0 36 10.0.0.202:22 10.0.0.44:45258 ESTAB 0 0 127.0.0.1:32965 127.0.0.1:4369 ESTAB 0 0 10.0.0.202:22 10.0.0.44:36104 LISTEN 0 128 :::80 :::* LISTEN 0 128 :::4369 :::* LISTEN 0 128 :::22 :::* LISTEN 0 128 :::5432 :::* LISTEN 0 128 :::3260 :::* LISTEN 0 128 :::5672 :::* ESTAB 0 0 ::ffff:127.0.0.1:4369 ::ffff:127.0.0.1:32965 used = net_helpers._get_source_ports_from_ss_output(output) print used {'22', '3260', '32965', '4369', '5432', '5672', '80'} You can see it returned '3260' but not '3306'. This bug can impact how fullstack picks which free ports to use for neutron-server and neutron-openvswitch-agent. ** Affects: neutron Importance: Undecided Status: New -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to neutron. https://bugs.launchpad.net/bugs/1567472 Title: net_helpers.get_free_namespace_port can return used ports Status in neutron: New Bug description: Here's a simplification of 'get_free_namespace_port': output = ip_wrapper.netns.execute(['ss', param]) used_ports = _get_source_ports_from_ss_output(output) # Parses 'ss' output and gets all used ports, this is the problematic part return get_unused_port(used_ports) Here's a demonstration: output = ip_wrapper.netns.execute(['ss', param]) print output State Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 10 127.0.0.1:6640 *:* LISTEN 0 128 *:46675 *:* LISTEN 0 128 *:22 *:* LISTEN 0 128 *:5432 *:* LISTEN 0 128 *:3260 *:* LISTEN 0 50 *:3306 *:* ESTAB 0 36 10.0.0.202:22 10.0.0.44:45258 ESTAB 0 0 127.0.0.1:32965 127.0.0.1:4369 ESTAB 0 0 10.0.0.202:22 10.0.0.44:36104 LISTEN 0 128 :::80 :::* LISTEN 0 128 :::4369 :::* LISTEN 0 128 :::22 :::* LISTEN 0 128 :::5432 :::* LISTEN 0 128 :::3260 :::* LISTEN 0 128 :::5672 :::* ESTAB 0 0 ::ffff:127.0.0.1:4369 ::ffff:127.0.0.1:32965 used = net_helpers._get_source_ports_from_ss_output(output) print used {'22', '3260', '32965', '4369', '5432', '5672', '80'} You can see it returned '3260' but not '3306'. This bug can impact how fullstack picks which free ports to use for neutron-server and neutron-openvswitch-agent. To manage notifications about this bug go to: https://bugs.launchpad.net/neutron/+bug/1567472/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : yahoo-eng-team@lists.launchpad.net Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp