[ovs-dev] Avoid update probe interval to non-zero for unix socket.

Message ID 1492535325-43222-1-git-send-email-zhouhan@gmail.com
State Superseded
Headers show

Commit Message

Han Zhou April 18, 2017, 5:08 p.m.
In commit xxxxxxxx it disables probe when not needed, but commit
715038b6 updates ovn-controller probe interval for OVNSB DB
periodically according to ovn-remote-probe-interval config, and sets
it to DEFAULT_PROBE_INTERVAL_MSEC if not configured, even if the
connection type is unix socket which doesn't need probe.

This fix avoids probe interval update if not needed (always set to 0).

Signed-off-by: Han Zhou <zhouhan@gmail.com>
---
 lib/reconnect.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Russell Bryant April 18, 2017, 5:25 p.m. | #1
On Tue, Apr 18, 2017 at 1:08 PM, Han Zhou <zhouhan@gmail.com> wrote:
> In commit xxxxxxxx it disables probe when not needed, but commit

I assume you meant to update this "xxxxxxx" with a commit ID?

> 715038b6 updates ovn-controller probe interval for OVNSB DB
> periodically according to ovn-remote-probe-interval config, and sets
> it to DEFAULT_PROBE_INTERVAL_MSEC if not configured, even if the
> connection type is unix socket which doesn't need probe.
>
> This fix avoids probe interval update if not needed (always set to 0).
>
> Signed-off-by: Han Zhou <zhouhan@gmail.com>
> ---
>  lib/reconnect.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/lib/reconnect.c b/lib/reconnect.c
> index 471fb7f..6b52481 100644
> --- a/lib/reconnect.c
> +++ b/lib/reconnect.c
> @@ -16,6 +16,7 @@
>
>  #include <config.h>
>  #include "reconnect.h"
> +#include "stream.h"
>
>  #include <stdlib.h>
>
> @@ -243,6 +244,9 @@ reconnect_set_backoff(struct reconnect *fsm, int min_backoff, int max_backoff)
>  void
>  reconnect_set_probe_interval(struct reconnect *fsm, int probe_interval)
>  {
> +    if (!stream_or_pstream_needs_probes(fsm->name)) {
> +        probe_interval = 0;
> +    }
>      fsm->probe_interval = probe_interval ? MAX(1000, probe_interval) : 0;
>  }
>
> --
> 2.1.0
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Han Zhou April 18, 2017, 6:06 p.m. | #2
sorry :D
I will update it.

On Tue, Apr 18, 2017 at 10:25 AM, Russell Bryant <russell@ovn.org> wrote:

> On Tue, Apr 18, 2017 at 1:08 PM, Han Zhou <zhouhan@gmail.com> wrote:
> > In commit xxxxxxxx it disables probe when not needed, but commit
>
> I assume you meant to update this "xxxxxxx" with a commit ID?
>
> > 715038b6 updates ovn-controller probe interval for OVNSB DB
> > periodically according to ovn-remote-probe-interval config, and sets
> > it to DEFAULT_PROBE_INTERVAL_MSEC if not configured, even if the
> > connection type is unix socket which doesn't need probe.
> >
> > This fix avoids probe interval update if not needed (always set to 0).
> >
> > Signed-off-by: Han Zhou <zhouhan@gmail.com>
> > ---
> >  lib/reconnect.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/lib/reconnect.c b/lib/reconnect.c
> > index 471fb7f..6b52481 100644
> > --- a/lib/reconnect.c
> > +++ b/lib/reconnect.c
> > @@ -16,6 +16,7 @@
> >
> >  #include <config.h>
> >  #include "reconnect.h"
> > +#include "stream.h"
> >
> >  #include <stdlib.h>
> >
> > @@ -243,6 +244,9 @@ reconnect_set_backoff(struct reconnect *fsm, int
> min_backoff, int max_backoff)
> >  void
> >  reconnect_set_probe_interval(struct reconnect *fsm, int probe_interval)
> >  {
> > +    if (!stream_or_pstream_needs_probes(fsm->name)) {
> > +        probe_interval = 0;
> > +    }
> >      fsm->probe_interval = probe_interval ? MAX(1000, probe_interval) :
> 0;
> >  }
> >
> > --
> > 2.1.0
> >
> > _______________________________________________
> > dev mailing list
> > dev@openvswitch.org
> > https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
>
>
> --
> Russell Bryant
>

Patch

diff --git a/lib/reconnect.c b/lib/reconnect.c
index 471fb7f..6b52481 100644
--- a/lib/reconnect.c
+++ b/lib/reconnect.c
@@ -16,6 +16,7 @@ 
 
 #include <config.h>
 #include "reconnect.h"
+#include "stream.h"
 
 #include <stdlib.h>
 
@@ -243,6 +244,9 @@  reconnect_set_backoff(struct reconnect *fsm, int min_backoff, int max_backoff)
 void
 reconnect_set_probe_interval(struct reconnect *fsm, int probe_interval)
 {
+    if (!stream_or_pstream_needs_probes(fsm->name)) {
+        probe_interval = 0;
+    }
     fsm->probe_interval = probe_interval ? MAX(1000, probe_interval) : 0;
 }