diff mbox

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

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

Commit Message

Han Zhou April 18, 2017, 6:12 p.m. UTC
In commit c1bfdd9d 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>
---

Notes:
    v1->v2: fix commit id mentioned in commit message.

 lib/reconnect.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox

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;
 }