Avoid race condition when processing RowEvents

In https://review.opendev.org/#/c/753824/ ovsdbapp adds the ability
to pass a "frozen" object to the RowEventHandler so that if a
transaction is started from the main thread that changes the row,
it won't step on the values that the Event is trying to process.

This patch switches to using the ovs_idl backend-specific
RowEventHandler which converts the row to a frozen_row.

Change-Id: I87489596e2ff224431f7e83f43a1725172ee0953
Related-Bug: #1896816
This commit is contained in:
Terry Wilson 2020-09-23 20:32:33 +00:00
parent 484f7fe78e
commit ab6d4afd95
3 changed files with 6 additions and 7 deletions

View File

@ -78,8 +78,8 @@ oslo.utils==4.4.0
oslo.versionedobjects==1.35.1
oslotest==3.2.0
osprofiler==2.3.0
ovs==2.8.0
ovsdbapp==1.4.0
ovs==2.10.0
ovsdbapp==1.6.0
packaging==20.4
Paste==2.0.2
PasteDeploy==1.5.0

View File

@ -27,7 +27,6 @@ from ovs.stream import Stream
from ovsdbapp.backend.ovs_idl import connection
from ovsdbapp.backend.ovs_idl import event as row_event
from ovsdbapp.backend.ovs_idl import idlutils
from ovsdbapp import event
from neutron.common.ovn import constants as ovn_const
from neutron.common.ovn import exceptions
@ -358,7 +357,7 @@ class NeutronPgDropPortGroupCreated(row_event.WaitEvent):
self.event_name = 'PortGroupCreated'
class OvnDbNotifyHandler(event.RowEventHandler):
class OvnDbNotifyHandler(row_event.RowEventHandler):
def __init__(self, driver):
super(OvnDbNotifyHandler, self).__init__()
self.driver = driver
@ -374,7 +373,7 @@ class Ml2OvnIdlBase(connection.OvsdbIdl):
class BaseOvnIdl(Ml2OvnIdlBase):
def __init__(self, remote, schema):
self.notify_handler = event.RowEventHandler()
self.notify_handler = row_event.RowEventHandler()
super(BaseOvnIdl, self).__init__(remote, schema)
@classmethod

View File

@ -44,8 +44,8 @@ oslo.utils>=4.4.0 # Apache-2.0
oslo.versionedobjects>=1.35.1 # Apache-2.0
osprofiler>=2.3.0 # Apache-2.0
os-ken >= 0.3.0 # Apache-2.0
ovs>=2.8.0 # Apache-2.0
ovsdbapp>=1.4.0 # Apache-2.0
ovs>=2.10.0 # Apache-2.0
ovsdbapp>=1.6.0 # Apache-2.0
packaging>=20.4 # Apache-2.0
psutil>=5.3.0 # BSD
pyroute2>=0.5.13;sys_platform!='win32' # Apache-2.0 (+ dual licensed GPL2)