From: Terry Wilson Date: Mon, 28 Sep 2015 22:42:25 +0000 (-0500) Subject: Check idl.run() return value before blocking X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=5dba2ac71c16cfd11937cf4becbaabd5b807678d;p=openstack-build%2Fneutron-build.git Check idl.run() return value before blocking The IDL change_seqno can change as a result of running idl.run(), and it returns True if there has been a change. The existing code would block without checking the return value, and therefor could block until another change occurred, or the timeout was reached. Closes-Bug: #1501090 Change-Id: I9b7aac2755e6e6b69165023e01583337f9d30f15 --- diff --git a/neutron/agent/ovsdb/native/idlutils.py b/neutron/agent/ovsdb/native/idlutils.py index 22aa0008a..b02acd305 100644 --- a/neutron/agent/ovsdb/native/idlutils.py +++ b/neutron/agent/ovsdb/native/idlutils.py @@ -115,8 +115,7 @@ def wait_for_change(_idl, timeout, seqno=None): if seqno is None: seqno = _idl.change_seqno stop = time.time() + timeout - while _idl.change_seqno == seqno: - _idl.run() + while _idl.change_seqno == seqno and not _idl.run(): ovs_poller = poller.Poller() _idl.wait(ovs_poller) ovs_poller.timer_wait(timeout * 1000)