diff options
author | Ben Pfaff <blp@nicira.com> | 2013-03-15 16:14:28 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2013-03-15 16:26:47 -0700 |
commit | fba6bd1d3f5891471daea8bf5da22303c2d889df (patch) | |
tree | e3ff999f81bd74286998b544047df725366bee1c /lib/ovsdb-idl.h | |
parent | cff78c8844bcce7c6b20fe30d56b5509232039d2 (diff) | |
download | openvswitch-fba6bd1d3f5891471daea8bf5da22303c2d889df.tar.gz |
ovs-vsctl: Try connecting only once for active connections by default.
Until now, ovs-vsctl has kept trying to the database server until it
succeeded or the timeout expired (if one was specified with --timeout).
This meant that if ovsdb-server wasn't running, then ovs-vsctl would hang.
The result was that almost every ovs-vsctl invocation in scripts specified
a timeout on the off-chance that the database server might not be running.
But it's difficult to choose a good timeout. A timeout that is too short
can cause spurious failures. A timeout that is too long causes long delays
if the server really isn't running.
This commit should alleviate this problem. It changes ovs-vsctl's behavior
so that, if it fails to connect to the server, it exits unsuccessfully.
This makes --timeout obsolete for the purpose of avoiding a hang if the
database server isn't running. (--timeout is still useful to avoid a hang
if ovsdb-server is running but ovs-vswitchd is not, for ovs-vsctl commands
that modify the database. --no-wait also avoids that issue.)
Bug #2393.
Bug #15594.
Reported-by: Jeff Merrick <jmerrick@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/ovsdb-idl.h')
-rw-r--r-- | lib/ovsdb-idl.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/ovsdb-idl.h b/lib/ovsdb-idl.h index b428501fa..6b5e198b2 100644 --- a/lib/ovsdb-idl.h +++ b/lib/ovsdb-idl.h @@ -44,7 +44,8 @@ struct uuid; struct ovsdb_idl *ovsdb_idl_create(const char *remote, const struct ovsdb_idl_class *, - bool monitor_everything_by_default); + bool monitor_everything_by_default, + bool retry); void ovsdb_idl_destroy(struct ovsdb_idl *); void ovsdb_idl_run(struct ovsdb_idl *); @@ -58,6 +59,9 @@ unsigned int ovsdb_idl_get_seqno(const struct ovsdb_idl *); bool ovsdb_idl_has_ever_connected(const struct ovsdb_idl *); void ovsdb_idl_force_reconnect(struct ovsdb_idl *); void ovsdb_idl_verify_write_only(struct ovsdb_idl *); + +bool ovsdb_idl_is_alive(const struct ovsdb_idl *); +int ovsdb_idl_get_last_error(const struct ovsdb_idl *); /* Choosing columns and tables to replicate. */ |