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.

Acked-by: Mark D. Gray <mark.d.g...@redhat.com>
Acked-by: Dumitru Ceara <dce...@redhat.com>
Signed-off-by: Ilya Maximets <i.maxim...@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)
 {
     jsonrpc_session_wait(s->js);
     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)) {
             poll_immediate_wake();
         } else {
             jsonrpc_session_recv_wait(s->js);
-- 
2.31.1

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to