When checking Service_Monitor, if pinctrl thread was setup to
wakeup at time T, and if it was waking up at exactly time T (same msec),
then pinctrl was looping until T (in msec) increased.

Signed-off-by: Xavier Simonart <[email protected]>

---
-v2: Moved test from patch 1/5.
---
 controller/pinctrl.c | 2 +-
 tests/system-ovn.at  | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/controller/pinctrl.c b/controller/pinctrl.c
index fcca24528..37d7d0aac 100644
--- a/controller/pinctrl.c
+++ b/controller/pinctrl.c
@@ -8126,7 +8126,7 @@ svc_monitors_run(struct rconn *swconn,
             break;
 
         case SVC_MON_S_WAITING:
-            if (current_time > svc_mon->wait_time) {
+            if (current_time >= svc_mon->wait_time) {
                 if (svc_mon->protocol ==  SVC_MON_PROTO_UDP) {
                     svc_mon->n_success++;
                     svc_mon->state = SVC_MON_S_ONLINE;
diff --git a/tests/system-ovn.at b/tests/system-ovn.at
index 8af7cb058..e104a6518 100644
--- a/tests/system-ovn.at
+++ b/tests/system-ovn.at
@@ -4440,6 +4440,7 @@ ovs-vsctl \
 
 # Start ovn-controller
 start_daemon ovn-controller
+ovn-appctl vlog/set poll_loop:dbg
 
 check ovn-nbctl ls-add sw0
 
@@ -4623,6 +4624,11 @@ OVS_WAIT_UNTIL([
     test "${n_reset}" = "1"
 ])
 
+# Check that we do not get too many immediate wake up.
+# Tolerate a few for any race conditions.
+AT_CHECK([test 5 -gt `cat ovn-controller.log | \
+grep -c "wakeup due to 0-ms timeout at controller/pinctrl.c:"`])
+
 OVN_CLEANUP_CONTROLLER([hv1])
 
 OVN_CLEANUP_NORTHD
-- 
2.47.1

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to