From 319ac92d9b47442368452b910f0985a2006eaa7a Mon Sep 17 00:00:00 2001 From: Terry Wilson Date: Wed, 15 Nov 2017 14:58:18 -0600 Subject: [PATCH] Don't wait on TRY_AGAIN when calling commit_block() commit_block() calls idl.run() already, so the seqno has already changed, and waiting again could potentially wait until a timeout occurs. From the ovs.db.idl docs: If the final status is Transaction.TRY_AGAIN, wait for Idl.change_seqno to change from the saved 'seqno' (it's possible that it's already changed, in which case the client should not wait at all), then start over from step 1. Only a call to Idl.run() will change the return value of Idl.change_seqno. (Transaction.commit_block() calls Idl.run().) This is backported from I1e5f4627f0488ba15ba2fb3509504bcf1b787b07 in the ovsdbapp project. Closes-Bug: #1627106 Change-Id: I1e5f4627f0488ba15ba2fb3509504bcf1b787b07 --- neutron/agent/ovsdb/impl_idl.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/neutron/agent/ovsdb/impl_idl.py b/neutron/agent/ovsdb/impl_idl.py index f9a9904683a..0b22dd87f78 100644 --- a/neutron/agent/ovsdb/impl_idl.py +++ b/neutron/agent/ovsdb/impl_idl.py @@ -105,12 +105,9 @@ class Transaction(api.Transaction): txn.abort() if not self.check_error: ctx.reraise = False - seqno = self.api.idl.change_seqno status = txn.commit_block() if status == txn.TRY_AGAIN: LOG.debug("OVSDB transaction returned TRY_AGAIN, retrying") - idlutils.wait_for_change(self.api.idl, self.time_remaining(), - seqno) continue elif status == txn.ERROR: msg = _("OVSDB Error: %s") % txn.get_error()