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 15e3df7f45
commit 84c07ca8a3
1 changed files with 3 additions and 0 deletions

View File

@ -157,6 +157,9 @@ class Connection(object):
class OvsdbIdl(idl.Idl):
def cooperative_yield(self):
time.sleep(0)
@classmethod
def from_server(cls, connection_string, schema_name):
"""Create the Idl instance by pulling the schema from OVSDB server"""