Add cooperative_yield() to OvsdbIdl

On python-ovs 2.16.0+, overriding cooperative_yield() will allow
potentially long-running CPU-intensive methods to cooperatively
yield to greenthreads. This patch + ovs 2.16.0+ will resolve
the related bug. I'll see if I can get cooperative_yield
backported in OVS as well.

Related-Bug: #1929446
Change-Id: Ibd3c7427cbcab81253e0ed700174be09908bdef7
(cherry picked from commit a2d3ef2a64)
This commit is contained in:
Terry Wilson 2021-11-12 10:58:22 -06:00
parent ab571f441c
commit 62ee947412
1 changed files with 3 additions and 0 deletions

View File

@ -159,6 +159,9 @@ class Connection(object):
class OvsdbIdl(idl.Idl):
def cooperative_yield(self):
time.sleep(0)
@classmethod
def from_server(cls, connection_string, schema_name, *args,
helper=None, helper_tables=None, **kwargs):