diff mbox series

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

Message ID 20210612020008.3944088-2-i.maximets@ovn.org
State Superseded
Headers show
Series OVSDB Relay Service Model. (Was: OVSDB 2-Tier deployment) | expand

Commit Message

Ilya Maximets June 12, 2021, 2 a.m. UTC
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@ovn.org>
---
 ovsdb/jsonrpc-server.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Mark Gray June 19, 2021, 5:23 p.m. UTC | #1
On 12/06/2021 03:00, Ilya Maximets wrote:
> 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@ovn.org>
> ---

Acked-by: Mark D. Gray <mark.d.gray@redhat.com>
Dumitru Ceara June 25, 2021, 1:33 p.m. UTC | #2
On 6/12/21 4:00 AM, Ilya Maximets wrote:
> 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@ovn.org>
> ---

Acked-by: Dumitru Ceara <dceara@redhat.com>
diff mbox series

Patch

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