summaryrefslogtreecommitdiff
path: root/lib/jsonrpc.c
diff options
context:
space:
mode:
authorIlya Maximets <i.maximets@ovn.org>2021-05-27 15:29:04 +0200
committerIlya Maximets <i.maximets@ovn.org>2021-06-07 21:03:16 +0200
commit964da9a8b7c00f3044c5ad493ecbb75b89e09542 (patch)
tree56e80febb38609c6c1f5a93a5c2b13fd17f8a021 /lib/jsonrpc.c
parent30ccf2c51b72d3b62350d8591f3fe709e76d98dd (diff)
downloadopenvswitch-964da9a8b7c00f3044c5ad493ecbb75b89e09542.tar.gz
jsonrpc: Disable inactivity probes if replay engine is active.
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@ovn.org> Acked-by: Dumitru Ceara <dceara@redhat.com>
Diffstat (limited to 'lib/jsonrpc.c')
-rw-r--r--lib/jsonrpc.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/jsonrpc.c b/lib/jsonrpc.c
index 8c5126ffc..926cbcb86 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);
}
@@ -914,6 +915,11 @@ jsonrpc_session_open_unreliably(struct jsonrpc *jsonrpc, uint8_t dscp)
reconnect_set_name(s->reconnect, jsonrpc_get_name(jsonrpc));
reconnect_set_max_tries(s->reconnect, 0);
reconnect_connected(s->reconnect, time_msec());
+
+ if (ovs_replay_is_active()) {
+ reconnect_set_probe_interval(s->reconnect, 0);
+ }
+
s->dscp = dscp;
s->rpc = jsonrpc;
s->stream = NULL;
@@ -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);
}