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().)

Closes-Bug: #1627106
Change-Id: I1e5f4627f0488ba15ba2fb3509504bcf1b787b07
This commit is contained in:
Terry Wilson 2017-11-15 13:05:18 -06:00
parent d7e3313b2c
commit 158ae06bce
1 changed files with 0 additions and 3 deletions

View File

@ -88,12 +88,9 @@ class Transaction(api.Transaction):
txn.abort()
if self.check_error:
raise
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()