From f6d384d7a2df5ba603bf7862853e9cb9fc70fcb4 Mon Sep 17 00:00:00 2001 From: Salvatore Orlando Date: Wed, 15 Jan 2014 12:45:22 -0800 Subject: [PATCH] Expunge session contents between plugin requests In the NVP plugin, metadata processing performs several plugin operations with the same context (and db session). The first operation might leave persisted objects in the session instance which then conflict with objects created in the second operation. Closes-Bug: #1266482 Change-Id: Ic9e2b952013610647aa222f1a8b6e33504b54b37 --- neutron/plugins/nicira/dhcp_meta/rpc.py | 1 + 1 file changed, 1 insertion(+) diff --git a/neutron/plugins/nicira/dhcp_meta/rpc.py b/neutron/plugins/nicira/dhcp_meta/rpc.py index bfb5181e3..3f2f0a3af 100644 --- a/neutron/plugins/nicira/dhcp_meta/rpc.py +++ b/neutron/plugins/nicira/dhcp_meta/rpc.py @@ -216,6 +216,7 @@ def _destroy_metadata_access_network(plugin, context, router_id, ports): plugin.remove_router_interface( context, router_id, {'port_id': meta_port['id']}) greenthread.sleep(0) # yield + context.session.expunge_all() try: # Remove network (this will remove the subnet too) plugin.delete_network(context, meta_net_id) -- 2.45.2