[ovs-dev] [PATCH v2 6/9] jsonrpc: Disable inactivity probes if replay engine is active.

Ilya Maximets i.maximets at ovn.org
Mon Apr 12 22:00:17 UTC 2021


Current version of replay engine doesn't handle time-based internal
events that results in stream send/receive.  Disabling jsonrpc inactivity
probes for now to not block process waiting for probe being sent.

The proper solution would be to implement correct record/replay
of time, probably, by recording time and using the time warping.

Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
---
 lib/jsonrpc.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/lib/jsonrpc.c b/lib/jsonrpc.c
index 8c5126ffc..09eeb902c 100644
--- a/lib/jsonrpc.c
+++ b/lib/jsonrpc.c
@@ -26,6 +26,7 @@
 #include "openvswitch/json.h"
 #include "openvswitch/list.h"
 #include "openvswitch/ofpbuf.h"
+#include "ovs-replay.h"
 #include "ovs-thread.h"
 #include "openvswitch/poll-loop.h"
 #include "reconnect.h"
@@ -888,7 +889,7 @@ jsonrpc_session_open_multiple(const struct svec *remotes, bool retry)
         reconnect_set_backoff(s->reconnect, INT_MAX, INT_MAX);
     }
 
-    if (!stream_or_pstream_needs_probes(name)) {
+    if (!stream_or_pstream_needs_probes(name) || ovs_replay_is_active()) {
         reconnect_set_probe_interval(s->reconnect, 0);
     }
 
@@ -913,6 +914,11 @@ jsonrpc_session_open_unreliably(struct jsonrpc *jsonrpc, uint8_t dscp)
     reconnect_set_quiet(s->reconnect, true);
     reconnect_set_name(s->reconnect, jsonrpc_get_name(jsonrpc));
     reconnect_set_max_tries(s->reconnect, 0);
+
+    if (ovs_replay_is_active()) {
+        reconnect_set_probe_interval(s->reconnect, 0);
+    }
+
     reconnect_connected(s->reconnect, time_msec());
     s->dscp = dscp;
     s->rpc = jsonrpc;
@@ -1279,6 +1285,9 @@ void
 jsonrpc_session_set_probe_interval(struct jsonrpc_session *s,
                                    int probe_interval)
 {
+    if (ovs_replay_is_active()) {
+        return;
+    }
     reconnect_set_probe_interval(s->reconnect, probe_interval);
 }
 
-- 
2.26.2



More information about the dev mailing list