From c9aaa87707cb12b94518fdcb822ce00fa98ff614 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 28 Jul 2009 10:21:03 -0700 Subject: [PATCH] Reduce default maximum connection timeout from 15 seconds to 8 seconds. Users at Nicira have commented that a maximum reconnection time of 15 seconds, which was the default, is too long. This commit cuts it to 8 seconds, on the theory that an administrator is willing to wait that long before deciding that a change that should restore connectivity did not work. --- debian/openvswitch-switch.template | 4 ++-- lib/rconn.c | 4 ++-- secchan/main.c | 4 ++-- secchan/ofproto.c | 2 +- secchan/secchan.8.in | 2 +- vswitchd/bridge.c | 2 +- vswitchd/ovs-vswitchd.conf.5.in | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/debian/openvswitch-switch.template b/debian/openvswitch-switch.template index 967b3cef..c43def12 100644 --- a/debian/openvswitch-switch.template +++ b/debian/openvswitch-switch.template @@ -140,8 +140,8 @@ MGMT_VCONNS="punix:/var/run/secchan.mgmt" # MAX_BACKOFF: The maximum time that secchan will wait between # attempts to connect to the controller. The valid range is 1 and up. -# If unset, secchan defaults to 15 seconds. -#MAX_BACKOFF=15 +# If unset, secchan defaults to 8 seconds. +#MAX_BACKOFF=8 # DAEMON_OPTS: Additional options to pass to secchan, e.g. "--fail=open" DAEMON_OPTS="" diff --git a/lib/rconn.c b/lib/rconn.c index 1301f25c..09c0e9dd 100644 --- a/lib/rconn.c +++ b/lib/rconn.c @@ -159,7 +159,7 @@ rconn_new_from_vconn(const char *name, struct vconn *vconn) * 'max_backoff' is the maximum number of seconds between attempts to connect * to the peer. The actual interval starts at 1 second and doubles on each * failure until it reaches 'max_backoff'. If 0 is specified, the default of - * 60 seconds is used. */ + * 8 seconds is used. */ struct rconn * rconn_create(int probe_interval, int max_backoff) { @@ -175,7 +175,7 @@ rconn_create(int probe_interval, int max_backoff) queue_init(&rc->txq); rc->backoff = 0; - rc->max_backoff = max_backoff ? max_backoff : 60; + rc->max_backoff = max_backoff ? max_backoff : 8; rc->backoff_deadline = TIME_MIN; rc->last_received = time_now(); rc->last_connected = time_now(); diff --git a/secchan/main.c b/secchan/main.c index b3192ab8..c3d50a65 100644 --- a/secchan/main.c +++ b/secchan/main.c @@ -291,7 +291,7 @@ parse_options(int argc, char *argv[], struct ofsettings *s) s->fail_mode = FAIL_OPEN; s->max_idle = 0; s->probe_interval = 0; - s->max_backoff = 15; + s->max_backoff = 8; s->update_resolv_conf = true; s->rate_limit = 0; s->burst_limit = 0; @@ -541,7 +541,7 @@ usage(void) " --inactivity-probe=SECS time between inactivity probes\n" " --max-idle=SECS max idle for flows set up by secchan\n" " --max-backoff=SECS max time between controller connection\n" - " attempts (default: 15 seconds)\n" + " attempts (default: 8 seconds)\n" " -l, --listen=METHOD allow management connections on METHOD\n" " (a passive OpenFlow connection method)\n" " --snoop=METHOD allow controller snooping on METHOD\n" diff --git a/secchan/ofproto.c b/secchan/ofproto.c index 599a9789..7445ef6e 100644 --- a/secchan/ofproto.c +++ b/secchan/ofproto.c @@ -333,7 +333,7 @@ ofproto_create(const char *datapath, const struct ofhooks *ofhooks, void *aux, /* Initialize OpenFlow connections. */ list_init(&p->all_conns); - p->controller = ofconn_create(p, rconn_create(15, 15)); + p->controller = ofconn_create(p, rconn_create(15, 8)); p->controller->pktbuf = pktbuf_create(); p->controller->miss_send_len = OFP_DEFAULT_MISS_SEND_LEN; p->listeners = NULL; diff --git a/secchan/secchan.8.in b/secchan/secchan.8.in index 61202044..af6e9e8f 100644 --- a/secchan/secchan.8.in +++ b/secchan/secchan.8.in @@ -294,7 +294,7 @@ Sets the maximum time between attempts to connect to the controller to \fIsecs\fR, which must be at least 1. The actual interval between connection attempts starts at 1 second and doubles on each failing attempt until it reaches the maximum. The default maximum backoff -time is 15 seconds. +time is 8 seconds. .TP \fB-l\fR, \fB--listen=\fImethod\fR diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 10bd2445..e9c63902 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -1213,7 +1213,7 @@ bridge_reconfigure_controller(struct bridge *br) if (!max_backoff) { max_backoff = cfg_get_int(0, "mgmt.max-backoff"); if (!max_backoff) { - max_backoff = 15; + max_backoff = 8; } } ofproto_set_max_backoff(br->ofproto, max_backoff); diff --git a/vswitchd/ovs-vswitchd.conf.5.in b/vswitchd/ovs-vswitchd.conf.5.in index bd0ffb74..57af2aa8 100644 --- a/vswitchd/ovs-vswitchd.conf.5.in +++ b/vswitchd/ovs-vswitchd.conf.5.in @@ -376,7 +376,7 @@ The specified TCP \fIport\fR (default: 6633) on the host at the given .PP The maximum time between attempts to connect to the controller may be specified in integral seconds with the \fBmgmt.max-backoff\fR key. The -default maximum backoff is 15 seconds, and the minimum value is 1 +default maximum backoff is 8 seconds, and the minimum value is 1 second. An inactivity probe may be configured with the \fBmgmt.inactivity-probe\fR -- 2.30.2