ovs-vsctl: Try connecting only once for active connections by default.
authorBen Pfaff <blp@nicira.com>
Fri, 15 Mar 2013 23:14:28 +0000 (16:14 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 15 Mar 2013 23:26:47 +0000 (16:26 -0700)
commitfba6bd1d3f5891471daea8bf5da22303c2d889df
treee3ff999f81bd74286998b544047df725366bee1c
parentcff78c8844bcce7c6b20fe30d56b5509232039d2
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>
23 files changed:
AUTHORS
NEWS
debian/ifupdown.sh
lib/jsonrpc.c
lib/jsonrpc.h
lib/ovsdb-idl.c
lib/ovsdb-idl.h
lib/reconnect.c
ovsdb/jsonrpc-server.c
tests/interface-reconfigure.at
tests/ovs-monitor-ipsec.at
tests/ovs-vsctl.at
tests/ovs-xapi-sync.at
tests/test-ovsdb.c
utilities/bugtool/ovs-bugtool-vsctl-show
utilities/ovs-ctl.in
utilities/ovs-save
utilities/ovs-vsctl.8.in
utilities/ovs-vsctl.c
vswitchd/bridge.c
xenserver/etc_xapi.d_plugins_openvswitch-cfg-update
xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py
xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py