Comment 10 for bug 1759971

Revision history for this message
Dmitrii Shcherbakov (dmitriis) wrote :

I think it's this portion of code that results in an issue:

https://github.com/openstack/neutron/blob/fbe308bdc12191c187343b5ef103dea9af738380/neutron/api/rpc/handlers/l3_rpc.py#L119-L129

# this populates "routers"
            routers = (
                self.l3plugin.list_active_sync_routers_on_active_l3_agent(
                    context, host, router_ids))

...
        if utils.is_extension_supported(
            self.plugin, constants.PORT_BINDING_EXT_ALIAS):
# ensures the right port binding
            self._ensure_host_set_on_ports(context, host, routers)
...
# the same data structure returned as after list_active_sync_routers_on_active_l3_agent without being refreshed
        return routers

_populate_mtu_and_subnets_for_ports is eventually called on a code path from list_active_sync_routers_on_active_l3_agent and this depends on a binding being other than "unbound".

It seems that we need to do list_active_sync_routers_on_active_l3_agent twice - I confirmed that routes get created if routers variable is refreshed after _ensure_host_set_on_ports before returning from sync_routers.