Removing rpc communication from db transaction

In a transaction context of ExtraRoute_db_mixin.update_router() was
called super method that uses subtransaction and communication with l3
agent. In case of agent's heartbeat happens while there is running
transaction, update heartbeat in agents table gets stuck in a deadlock.

Closes-Bug: #1211915
Change-Id: I96e6a9d7172d5a0e3e720a81fcd10f04c40aef07
This commit is contained in:
Jakub Libosvar 2013-10-03 19:45:09 +02:00
parent 512bdfa713
commit 79bd3896d0

View File

@ -71,13 +71,11 @@ class ExtraRoute_db_mixin(l3_db.L3_NAT_db_mixin):
#check if route exists and have permission to access #check if route exists and have permission to access
router_db = self._get_router(context, id) router_db = self._get_router(context, id)
if 'routes' in r: if 'routes' in r:
self._update_extra_routes(context, self._update_extra_routes(context, router_db, r['routes'])
router_db, routes = self._get_extra_routes_by_router_id(context, id)
r['routes']) router_updated = super(ExtraRoute_db_mixin, self).update_router(
router_updated = super(ExtraRoute_db_mixin, self).update_router( context, id, router)
context, id, router) router_updated['routes'] = routes
router_updated['routes'] = self._get_extra_routes_by_router_id(
context, id)
return router_updated return router_updated