I performed the following test where I create policy action/policy classifier/rules/ruleset and than policy target group and policy target followed by cleanup in reverse fashion
When I perform this action repeatedly few times I see an exception in deleting a policy target group
The neutron logs points to this
Error from API endpoint
2015-06-04 15:27:00.129 62647 INFO rally.benchmark.runners.base [-] Task 392c312e-a3e7-4310-bcad-b728d4dadd1a | ITER: 14 END: Error InternalServerError: delete_policy_target_group_postcommit failed.
Neutron server logs
2015-06-04 15:41:11.248 21739 INFO neutron.wsgi [req-00212dfd-dea8-4781-9d63-a9d367756cd9 None] 172.29.172.181 - - [04/Jun/2015 15:41:11] "GET //v2.0/grouppolicy/policy_target_groups.json HTTP/1.1" 200 683 0.011423
2015-06-04 15:41:11.252 21740 INFO neutron.wsgi [-] (21740) accepted ('172.29.172.181', 37379)
2015-06-04 15:41:11.287 21750 WARNING neutron.plugins.ml2.rpc [req-f4416c72-ee01-487e-9825-7a226d6a28b1 None] Device tapcc41246f-38 requested by agent lb322c719718a8 not found in database
2015-06-04 15:41:11.504 21740 WARNING neutron.plugins.ml2.plugin [req-e9ec3157-b04f-4221-8a1e-c92e059a50b5 None] In _notify_port_updated(), no bound segment for port 3a83d432-b208-4418-b790-f47200347bb3 on network 1bd093df-2986-4db4-a49e-1e607b902879
2015-06-04 15:41:11.525 21740 INFO neutron.wsgi [req-e9ec3157-b04f-4221-8a1e-c92e059a50b5 None] 172.29.172.181 - - [04/Jun/2015 15:41:11] "POST //v2.0/grouppolicy/policy_targets.json HTTP/1.1" 201 514 0.272161
2015-06-04 15:41:11.531 21740 INFO neutron.wsgi [-] (21740) accepted ('172.29.172.181', 37380)
2015-06-04 15:41:11.538 21740 INFO neutron.wsgi [req-73fc258a-1117-4f98-a8af-88fc4fbda18c None] 172.29.172.181 - - [04/Jun/2015 15:41:11] "GET //v2.0/grouppolicy/policy_targets.json HTTP/1.1" 200 512 0.007169
2015-06-04 15:41:11.542 21740 INFO neutron.wsgi [-] (21740) accepted ('172.29.172.181', 37381)
2015-06-04 15:41:11.654 21740 WARNING neutron.plugins.ml2.plugin [req-2b240cf7-e3c6-4fe7-8d30-96f429222f7e None] In _notify_port_updated(), no bound segment for port 3a83d432-b208-4418-b790-f47200347bb3 on network 1bd093df-2986-4db4-a49e-1e607b902879
2015-06-04 15:41:11.776 21740 INFO neutron.wsgi [req-2b240cf7-e3c6-4fe7-8d30-96f429222f7e None] 172.29.172.181 - - [04/Jun/2015 15:41:11] "DELETE //v2.0/grouppolicy/policy_targets/7f2a19ea-b681-49cc-a786-bbc1b5c8f334.json HTTP/1.1" 204 173 0.233289
2015-06-04 15:41:11.783 21739 INFO neutron.wsgi [-] (21739) accepted ('172.29.172.181', 37382)
2015-06-04 15:41:11.797 21739 INFO neutron.wsgi [req-96035941-1822-4b0b-a0b9-791a0f1889ea None] 172.29.172.181 - - [04/Jun/2015 15:41:11] "GET //v2.0/grouppolicy/policy_target_groups.json HTTP/1.1" 200 683 0.013012
2015-06-04 15:41:11.801 21741 INFO neutron.wsgi [-] (21741) accepted ('172.29.172.181', 37383)
2015-06-04 15:41:11.867 21743 WARNING neutron.api.rpc.handlers.dhcp_rpc [req-c7635152-d32f-43fd-8891-ff0c89f39bc0 None] Network 8f04cf7d-f7f5-42b0-9bfe-4d21ffed3f7e could not be found, it might have been deleted concurrently.
2015-06-04 15:41:11.972 21741 WARNING gbpservice.neutron.services.grouppolicy.drivers.resource_mapping [req-2b1685cf-5b82-4ef1-8881-1a7d56d34135 None] Security Group already exists Security group rule already exists. Rule id is %(id)s.
2015-06-04 15:41:12.270 21741 ERROR gbpservice.neutron.services.grouppolicy.policy_driver_manager [req-2b1685cf-5b82-4ef1-8881-1a7d56d34135 None] Policy driver 'resource_mapping' failed in delete_policy_target_group_postcommit
2015-06-04 15:41:12.270 21741 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager Traceback (most recent call last):
2015-06-04 15:41:12.270 21741 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager File "/usr/lib/python2.7/site-packages/gbpservice/neutron/services/grouppolicy/policy_driver_manager.py", line 119, in _call_on_drivers
2015-06-04 15:41:12.270 21741 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager getattr(driver.obj, method_name)(context)
2015-06-04 15:41:12.270 21741 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager File "/usr/lib/python2.7/site-packages/neutron/common/log.py", line 34, in wrapper
2015-06-04 15:41:12.270 21741 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager return method(*args, **kwargs)
2015-06-04 15:41:12.270 21741 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager File "/usr/lib/python2.7/site-packages/gbpservice/neutron/services/grouppolicy/drivers/resource_mapping.py", line 514, in delete_policy_target_group_postcommit
2015-06-04 15:41:12.270 21741 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager self._cleanup_subnet(context._plugin_context, subnet_id, router_id)
2015-06-04 15:41:12.270 21741 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager File "/usr/lib/python2.7/site-packages/gbpservice/neutron/services/grouppolicy/drivers/resource_mapping.py", line 1131, in _cleanup_subnet
2015-06-04 15:41:12.270 21741 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager self._delete_subnet(plugin_context, subnet_id)
2015-06-04 15:41:12.270 21741 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager File "/usr/lib/python2.7/site-packages/gbpservice/neutron/services/grouppolicy/drivers/resource_mapping.py", line 1380, in _delete_subnet
2015-06-04 15:41:12.270 21741 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager subnet_id)
2015-06-04 15:41:12.270 21741 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager File "/usr/lib/python2.7/site-packages/gbpservice/neutron/services/grouppolicy/drivers/resource_mapping.py", line 1581, in _delete_resource
2015-06-04 15:41:12.270 21741 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager obj_deleter(context, resource_id)
2015-06-04 15:41:12.270 21741 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager File "/usr/lib/python2.7/site-packages/neutron/plugins/ml2/plugin.py", line 751, in delete_subnet
2015-06-04 15:41:12.270 21741 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager AUTO_DELETE_PORT_OWNERS for a in allocated))
2015-06-04 15:41:12.270 21741 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager File "/usr/lib/python2.7/site-packages/neutron/plugins/ml2/plugin.py", line 751, in <genexpr>
2015-06-04 15:41:12.270 21741 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager AUTO_DELETE_PORT_OWNERS for a in allocated))
2015-06-04 15:41:12.270 21741 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager AttributeError: 'NoneType' object has no attribute 'device_owner'
2015-06-04 15:41:12.270 21741 TRACE gbpservice.neutron.services.grouppolicy.policy_driver_manager
2015-06-04 15:41:12.587 21741 ERROR gbpservice.neutron.services.grouppolicy.plugin [req-2b1685cf-5b82-4ef1-8881-1a7d56d34135 None] delete_policy_target_group_postcommit failed, deleting policy_target_group '3b3b76c4-aaf1-47b7-8607-f113de96491a'
2015-06-04 15:41:12.587 21741 ERROR neutron.api.v2.resource [req-2b1685cf-5b82-4ef1-8881-1a7d56d34135 None] delete failed
2015-06-04 15:41:12.587 21741 TRACE neutron.api.v2.resource Traceback (most recent call last):
2015-06-04 15:41:12.587 21741 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/site-packages/neutron/api/v2/resource.py", line 87, in resource
2015-06-04 15:41:12.587 21741 TRACE neutron.api.v2.resource result = method(request=request, **args)
2015-06-04 15:41:12.587 21741 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/site-packages/neutron/api/v2/base.py", line 476, in delete
2015-06-04 15:41:12.587 21741 TRACE neutron.api.v2.resource obj_deleter(request.context, id, **kwargs)
2015-06-04 15:41:12.587 21741 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/site-packages/neutron/common/log.py", line 34, in wrapper
2015-06-04 15:41:12.587 21741 TRACE neutron.api.v2.resource return method(*args, **kwargs)
2015-06-04 15:41:12.587 21741 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/site-packages/gbpservice/neutron/services/grouppolicy/plugin.py", line 455, in delete_policy_target_group
2015-06-04 15:41:12.587 21741 TRACE neutron.api.v2.resource policy_target_group_id)
2015-06-04 15:41:12.587 21741 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/site-packages/neutron/openstack/common/excutils.py", line 82, in __exit__
2015-06-04 15:41:12.587 21741 TRACE neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2015-06-04 15:41:12.587 21741 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/site-packages/gbpservice/neutron/services/grouppolicy/plugin.py", line 450, in delete_policy_target_group
2015-06-04 15:41:12.587 21741 TRACE neutron.api.v2.resource policy_context)
2015-06-04 15:41:12.587 21741 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/site-packages/gbpservice/neutron/services/grouppolicy/policy_driver_manager.py", line 173, in delete_policy_target_group_postcommit
2015-06-04 15:41:12.587 21741 TRACE neutron.api.v2.resource continue_on_failure=True)
2015-06-04 15:41:12.587 21741 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/site-packages/gbpservice/neutron/services/grouppolicy/policy_driver_manager.py", line 134, in _call_on_drivers
2015-06-04 15:41:12.587 21741 TRACE neutron.api.v2.resource method=method_name
2015-06-04 15:41:12.587 21741 TRACE neutron.api.v2.resource GroupPolicyDriverError: delete_policy_target_group_postcommit failed.
2015-06-04 15:41:12.587 21741 TRACE neutron.api.v2.resource
Not able to reproduce.