[ovs-dev] [PATCH v2 1/9] jsonrpc-server: Wake up jsonrpc session if there are completed triggers.

Ilya Maximets i.maximets at ovn.org
Sat Jun 12 02:00:00 UTC 2021

If there are completed triggers, jsonrpc server should wake up and
update clients with the new data, but there is no such condition
in ovsdb_jsonrpc_session_wait().  For some reason this doesn't result
in any processing delays in current code, probably because there are
always some other types of events in this case that could wake ovsdb
server up.  But it will become a problem in upcoming ovsdb 'relay'
service model because triggers could be completed from a different
place, i.e. after receiving transaction reply from the relay source.

Fix that by waking up ovsdb-server in case there are completed triggers
that needs to be handled.

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

diff --git a/ovsdb/jsonrpc-server.c b/ovsdb/jsonrpc-server.c
index 4e2dfc3d7..351c39d8a 100644
--- a/ovsdb/jsonrpc-server.c
+++ b/ovsdb/jsonrpc-server.c
@@ -600,7 +600,8 @@ ovsdb_jsonrpc_session_wait(struct ovsdb_jsonrpc_session *s)
     if (!jsonrpc_session_get_backlog(s->js)) {
-        if (ovsdb_jsonrpc_monitor_needs_flush(s)) {
+        if (ovsdb_jsonrpc_monitor_needs_flush(s)
+            || !ovs_list_is_empty(&s->up.completions)) {
         } else {

More information about the dev mailing list