cannot delete v2 healthmonitor if the hm-associated-pool was deleted first

Bug #1450375 reported by LIU Yulong
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Undecided
LIU Yulong

Bug Description

Steps:
1. create lb
2. create listener
3. create pool (pool-1)
4. add a healthmonitor (healthmonitor-1) to pool-1
5. delete the pool-1

Then, you cannot delete healthmonitor-1 if the pool-1 was deleted first.

Log:

2015-04-30 16:51:23.422 6369 INFO neutron.wsgi [req-2876374c-03c3-49b6-825c-83116108cbed cf6a52a3be734e4cad457d5283148882 356b4d225c7e44de961d888086948f7c - - -] 172.16.2.10 - - [30/Apr/2015 16:51:23] "GET /v2.0/lbaas/healthmonitors.json?tenant_id=356b4d225c7e44de961d888086948f7c HTTP/1.1" 200 754 0.280336
2015-04-30 16:51:23.430 6369 INFO neutron.wsgi [-] (6369) accepted ('172.16.2.10', 17115)
2015-04-30 16:51:23.532 6369 ERROR neutron.api.v2.resource [req-88a2316d-805a-4bad-a52b-b270325008e7 cf6a52a3be734e4cad457d5283148882 356b4d225c7e44de961d888086948f7c - - -] delete failed
2015-04-30 16:51:23.532 6369 TRACE neutron.api.v2.resource Traceback (most recent call last):
2015-04-30 16:51:23.532 6369 TRACE neutron.api.v2.resource File "/usr/lib/python2.6/site-packages/neutron/api/v2/resource.py", line 83, in resource
2015-04-30 16:51:23.532 6369 TRACE neutron.api.v2.resource result = method(request=request, **args)
2015-04-30 16:51:23.532 6369 TRACE neutron.api.v2.resource File "/usr/lib/python2.6/site-packages/neutron/api/v2/base.py", line 490, in delete
2015-04-30 16:51:23.532 6369 TRACE neutron.api.v2.resource obj_deleter(request.context, id, **kwargs)
2015-04-30 16:51:23.532 6369 TRACE neutron.api.v2.resource File "/usr/lib/python2.6/site-packages/neutron_lbaas/services/loadbalancer/plugin.py", line 887, in delete_healthmonitor
2015-04-30 16:51:23.532 6369 TRACE neutron.api.v2.resource constants.PENDING_DELETE)
2015-04-30 16:51:23.532 6369 TRACE neutron.api.v2.resource File "/usr/lib/python2.6/site-packages/neutron_lbaas/db/loadbalancer/loadbalancer_dbv2.py", line 159, in test_and_set_status
2015-04-30 16:51:23.532 6369 TRACE neutron.api.v2.resource db_lb_child.root_loadbalancer.id)
2015-04-30 16:51:23.532 6369 TRACE neutron.api.v2.resource File "/usr/lib/python2.6/site-packages/neutron_lbaas/db/loadbalancer/models.py", line 115, in root_loadbalancer
2015-04-30 16:51:23.532 6369 TRACE neutron.api.v2.resource return self.pool.listener.loadbalancer
2015-04-30 16:51:23.532 6369 TRACE neutron.api.v2.resource AttributeError: 'NoneType' object has no attribute 'listener'

Code:

class HealthMonitorV2(model_base.BASEV2, models_v2.HasId, models_v2.HasTenant):

    ...

    @property
    def root_loadbalancer(self):
        return self.pool.listener.loadbalancer

Potential Solution:
1. Check pool whether binding a healthmonitor before delete
2. Add loadbalancer attr to HealthMonitorV2

LIU Yulong (dragon889)
summary: - cannot delete healthmonitor if the hm-associated-pool was deleted first
+ cannot delete v2 healthmonitor if the hm-associated-pool was deleted
+ first
description: updated
LIU Yulong (dragon889)
Changed in neutron:
assignee: nobody → LIU Yulong (dragon889)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron-lbaas (master)

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

Changed in neutron:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron-lbaas (master)

Change abandoned by Armando Migliaccio (<email address hidden>) on branch: master
Review: https://review.openstack.org/179684
Reason: This review is > 4 weeks without comment, and failed Jenkins the last time it was checked. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and leaving a 'recheck' comment to get fresh test results.

Changed in neutron:
status: In Progress → Incomplete
assignee: LIU Yulong (dragon889) → nobody
Changed in neutron:
assignee: nobody → LIU Yulong (dragon889)
status: Incomplete → In Progress
Revision history for this message
Alex Stafeyev (astafeye) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by LIU Yulong (<email address hidden>) on branch: master
Review: https://review.openstack.org/179684
Reason: What a pity it's more than a year that this patch is still not merged, please see the alternative patch :
https://review.openstack.org/#/c/324380/
4effc9b96ef6317cefb25768dd60bd0f5f4abac5

Revision history for this message
LIU Yulong (dragon889) wrote :

Please see the alternative fix:
https://review.openstack.org/#/c/324380/

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
Dariusz Smigiel (smigiel-dariusz) wrote :

Marked this bug as duplicate, even thou it was created earlier, but fix is assigned to other one.

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.