Failed HA router initialization can lead to exception

Bug #1735557 reported by Brian Haley
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Undecided
Brian Haley

Bug Description

When an HA router initialization fails, it can lead to the following exception:

ERROR neutron.agent.l3.ha_router [-] Unable to process HA router 59fad7c2-d393-464f-820b-334927047e64 without HA port
TRACE neutron.agent.l3.ha_router None
TRACE neutron.agent.l3.ha_router
ERROR neutron.agent.l3.agent [-] Error while initializing router 59fad7c2-d393-464f-820b-334927047e64
TRACE neutron.agent.l3.agent Traceback (most recent call last):
TRACE neutron.agent.l3.agent File "/usr/lib/python2.7/site-packages/neutron/agent/l3/agent.py", line 335, in _router_added
TRACE neutron.agent.l3.agent ri.initialize(self.process_monitor)
TRACE neutron.agent.l3.agent File "/usr/lib/python2.7/site-packages/neutron/agent/l3/ha_router.py", line 83, in initialize
TRACE neutron.agent.l3.agent raise Exception(msg)
TRACE neutron.agent.l3.agent Exception: Unable to process HA router 59fad7c2-d393-464f-820b-334927047e64 without HA port
TRACE neutron.agent.l3.agent
ERROR neutron.agent.l3.agent [-] Error while deleting router 59fad7c2-d393-464f-820b-334927047e64
TRACE neutron.agent.l3.agent Traceback (most recent call last):
TRACE neutron.agent.l3.agent File "/usr/lib/python2.7/site-packages/neutron/agent/l3/agent.py", line 342, in _router_added
TRACE neutron.agent.l3.agent ri.delete(self)
TRACE neutron.agent.l3.agent File "/usr/lib/python2.7/site-packages/neutron/agent/l3/ha_router.py", line 359, in delete
TRACE neutron.agent.l3.agent self.destroy_state_change_monitor(self.process_monitor)
TRACE neutron.agent.l3.agent AttributeError: 'HaRouter' object has no attribute 'process_monitor'

The problem is that self.process_monitor is added in RouterInfo.initialize(), but that isn't called after we verify an ha_port exists in HaRouter.initialize().

Adding 'self.process_monitor = None' in RouterInfo.__init__ should fix the problem.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/524404

Changed in neutron:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/524404
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=c62d54d0c21fc4a760d2ac6501f9493137c5eb8a
Submitter: Zuul
Branch: master

commit c62d54d0c21fc4a760d2ac6501f9493137c5eb8a
Author: Brian Haley <email address hidden>
Date: Thu Nov 30 16:47:43 2017 -0500

    Fix HA router initialization exception

    When an HA router initialization fails early, it can lead to:

     AttributeError: 'HaRouter' object has no attribute 'process_monitor'

    Add init of 'self.process_monitor' in RouterInfo init code in
    case we try and cleanup early.

    Change-Id: Iddeaeef13adee10f7b130e3f9e584b6e9f037030
    Closes-bug: #1735557

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/pike)

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/525219

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/ocata)

Fix proposed to branch: stable/ocata
Review: https://review.openstack.org/525220

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/pike)

Reviewed: https://review.openstack.org/525219
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=0b960a95c8f093e6e215f87b66a103fd6cf45a07
Submitter: Zuul
Branch: stable/pike

commit 0b960a95c8f093e6e215f87b66a103fd6cf45a07
Author: Brian Haley <email address hidden>
Date: Thu Nov 30 16:47:43 2017 -0500

    Fix HA router initialization exception

    When an HA router initialization fails early, it can lead to:

     AttributeError: 'HaRouter' object has no attribute 'process_monitor'

    Add init of 'self.process_monitor' in RouterInfo init code in
    case we try and cleanup early.

    Change-Id: Iddeaeef13adee10f7b130e3f9e584b6e9f037030
    Closes-bug: #1735557
    (cherry picked from commit c62d54d0c21fc4a760d2ac6501f9493137c5eb8a)

tags: added: in-stable-pike
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 12.0.0.0b2

This issue was fixed in the openstack/neutron 12.0.0.0b2 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/ocata)

Reviewed: https://review.openstack.org/525220
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=c3fa8f008e5c15307767ec0de0a4e6d1c7e974d0
Submitter: Zuul
Branch: stable/ocata

commit c3fa8f008e5c15307767ec0de0a4e6d1c7e974d0
Author: Brian Haley <email address hidden>
Date: Thu Nov 30 16:47:43 2017 -0500

    Fix HA router initialization exception

    When an HA router initialization fails early, it can lead to:

     AttributeError: 'HaRouter' object has no attribute 'process_monitor'

    Add init of 'self.process_monitor' in RouterInfo init code in
    case we try and cleanup early.

    Change-Id: Iddeaeef13adee10f7b130e3f9e584b6e9f037030
    Closes-bug: #1735557
    (cherry picked from commit c62d54d0c21fc4a760d2ac6501f9493137c5eb8a)

tags: added: in-stable-ocata
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 10.0.5

This issue was fixed in the openstack/neutron 10.0.5 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 11.0.3

This issue was fixed in the openstack/neutron 11.0.3 release.

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.