When many update notifications arrive in a short time, it may happen that we only process the first 50 of them and have to wait until the next iteration to pick them up.
Because previously, there was no way for an operator to observe how often this happened, we add a coverage metric for this event. Signed-off-by: Martin Morgenstern <[email protected]> --- lib/ovsdb-cs.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/ovsdb-cs.c b/lib/ovsdb-cs.c index 98386532d..81a09da6e 100644 --- a/lib/ovsdb-cs.c +++ b/lib/ovsdb-cs.c @@ -20,6 +20,7 @@ #include <errno.h> +#include "coverage.h" #include "hash.h" #include "jsonrpc.h" #include "openvswitch/dynamic-string.h" @@ -40,6 +41,8 @@ VLOG_DEFINE_THIS_MODULE(ovsdb_cs); +COVERAGE_DEFINE(ovsdb_cs_run_batch_full); + /* Connection state machine. * * When a JSON-RPC session connects, the CS layer sends a "monitor_cond" @@ -639,11 +642,13 @@ ovsdb_cs_run(struct ovsdb_cs *cs, struct ovs_list *events) } } + bool aborted = false; int ret; for (int i = 0; i < 50; i++) { struct jsonrpc_msg *msg = NULL; ret = jsonrpc_session_recv(cs->session, &msg); if (ret == EAGAIN) { + aborted = true; break; } /* Even if we would not block we might not receive a message for two @@ -656,6 +661,9 @@ ovsdb_cs_run(struct ovsdb_cs *cs, struct ovs_list *events) } } + if (!aborted) { + COVERAGE_INC(ovsdb_cs_run_batch_full); + } /* Send a gratuitous (unsolicited) echo reply if necessary and we didn't * do it already in the above batch. This is an preemptive activity -- 2.45.2 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
