if L3 agent is down, it should not schedule router on it

Bug #1401823 reported by shihanzhang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Invalid
Undecided
shihanzhang

Bug Description

when neutron server schedule routers, if l3 agent is down, it should not schedule router on it,

    def auto_schedule_routers(self, plugin, context, host, router_ids):
        l3_agent = plugin.get_enabled_agent_on_host(
            context, constants.AGENT_TYPE_L3, host)
        if not l3_agent:
            return False

if l3 agent is down, the 'plugin.get_enabled_agent_on_host' should be None,

    def get_enabled_agent_on_host(self, context, agent_type, host):
        """Return agent of agent_type for the specified host."""
        query = context.session.query(Agent)
        query = query.filter(Agent.agent_type == agent_type,
                             Agent.host == host,
                             Agent.admin_state_up == sql.true())
        try:
            agent = query.one()
        except exc.NoResultFound:
            LOG.debug('No enabled %(agent_type)s agent on host '
                      '%(host)s' % {'agent_type': agent_type, 'host': host})
            return
        if self.is_agent_down(agent.heartbeat_timestamp):
            LOG.warn(_LW('%(agent_type)s agent %(agent_id)s is not active'),
                     {'agent_type': agent_type, 'agent_id': agent.id})
        return agent

so, ' if self.is_agent_down', it should return None

Tags: l3-ipam-dhcp
Changed in neutron:
assignee: nobody → shihanzhang (shihanzhang)
tags: added: l3-ipam-dhcp
Revision history for this message
Eugene Nikanorov (enikanorov) wrote :

auto_schedule_routers method is called from RPC handler which is invoked by remote L3 agent.
That implies that L3 agent is active and tries to get routers to be scheduled on it.

So I'm not sure if there is a real issue here.

Changed in neutron:
status: New → Incomplete
Revision history for this message
shihanzhang (shihanzhang) wrote :

ok, I agree with you, the 'get_routers' is a call() method!

Changed in neutron:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.