[ovs-dev] [PATCH] ovs-xapi-sync: Add retries while getting single bridge ids.

Ben Pfaff blp at nicira.com
Sat Jun 15 02:03:39 UTC 2013

On Fri, Jun 14, 2013 at 09:52:59AM -0700, Gurucharan Shetty wrote:
> When there are multiple xs-network-uuids set for a bridge,
> we query xapi to get the record that does not have a VLAN
> associated with it. For cases when xapi does not respond,
> retry a few times and log the failures.
> If after the retries, we still do not get the correct record,
> set the external_ids:bridge_id as empty("").
> Bug #17877.
> Signed-off-by: Gurucharan Shetty <gshetty at nicira.com>

I wonder whether this is the best way to do retry.  Five retries over
five seconds seems pretty arbitrary.  What if XAPI takes more than 5
seconds to restart?  I think that, then, we'll take "" as the bridge-id
and cache it.

If you think that this is a valid objection, then another approach would
be to use "" (or None) as the bridge-id immediately (without retrying),
but not to cache the bridge-id and, in the next iteration of the main
loop, wait at most 1 second before starting the next transaction.  Then,
we would continue to retry (indefinitely) without blocking all database
updates in the meantime.

Another thought: when it starts up, ovs-xapi-sync waits until xapi is
ready by waiting for a file /var/run/xapi_init_complete.cookie to be
created.  If XAPI is restarting, perhaps this file is deleted until the
restart completes (I do not know whether this is true) and perhaps that
could somehow be a hint that the XAPI connection is not going to work
for a while.

More information about the dev mailing list