Reduce default maximum connection timeout from 15 seconds to 8 seconds.
authorBen Pfaff <blp@nicira.com>
Tue, 28 Jul 2009 17:21:03 +0000 (10:21 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 29 Jul 2009 18:29:18 +0000 (11:29 -0700)
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
lib/rconn.c
secchan/main.c
secchan/ofproto.c
secchan/secchan.8.in
vswitchd/bridge.c
vswitchd/ovs-vswitchd.conf.5.in

index 967b3ce..c43def1 100644 (file)
@@ -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.
 
 # 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=""
 
 # DAEMON_OPTS: Additional options to pass to secchan, e.g. "--fail=open"
 DAEMON_OPTS=""
index 1301f25..09c0e9d 100644 (file)
@@ -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
  * '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)
 {
 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;
     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();
     rc->backoff_deadline = TIME_MIN;
     rc->last_received = time_now();
     rc->last_connected = time_now();
index b3192ab..c3d50a6 100644 (file)
@@ -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->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;
     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"
            "  --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"
            "  -l, --listen=METHOD     allow management connections on METHOD\n"
            "                          (a passive OpenFlow connection method)\n"
            "  --snoop=METHOD          allow controller snooping on METHOD\n"
index 599a978..7445ef6 100644 (file)
@@ -333,7 +333,7 @@ ofproto_create(const char *datapath, const struct ofhooks *ofhooks, void *aux,
 
     /* Initialize OpenFlow connections. */
     list_init(&p->all_conns);
 
     /* 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;
     p->controller->pktbuf = pktbuf_create();
     p->controller->miss_send_len = OFP_DEFAULT_MISS_SEND_LEN;
     p->listeners = NULL;
index 6120204..af6e9e8 100644 (file)
@@ -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
 \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
 
 .TP
 \fB-l\fR, \fB--listen=\fImethod\fR
index 10bd244..e9c6390 100644 (file)
@@ -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) {
         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);
             }
         }
         ofproto_set_max_backoff(br->ofproto, max_backoff);
index bd0ffb7..57af2aa 100644 (file)
@@ -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
 .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
 second.
 
 An inactivity probe may be configured with the \fBmgmt.inactivity-probe\fR