diff mbox series

[ovs-dev] pinctrl: fix bug of monitor status in health check

Message ID 20220801130103.153590-1-wangchuanlei@inspur.com
State Rejected
Headers show
Series [ovs-dev] pinctrl: fix bug of monitor status in health check | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/github-robot-_ovn-kubernetes success github build: passed

Commit Message

wangchuanlei Aug. 1, 2022, 1:01 p.m. UTC
when vm of backend do not send reply packet,
monitor state should change from waiting to offline,
 this patch is to fix it!

Signed-off-by: wangchuanlei <wangchuanlei@inspur.com>
---
 controller/pinctrl.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

Comments

Numan Siddique Aug. 8, 2022, 1:19 a.m. UTC | #1
On Mon, Aug 1, 2022 at 11:06 PM wangchuanlei <wangchuanlei@inspur.com> wrote:
>
> when vm of backend do not send reply packet,
> monitor state should change from waiting to offline,
>  this patch is to fix it!
>
> Signed-off-by: wangchuanlei <wangchuanlei@inspur.com>

This patch breaks the service monitor functionality for UDP.

For UDP protocol, the service monitor's state is set to ONLINE when
the wait time elapses and ovn-controller doesn't receive any
 ICMP4_DST_UNREACH packet.

But this patch changes the behavior and it will never set the state to
ONLINE for UDP.
Please see this - https://github.com/ovn-org/ovn/blob/main/ovn-sb.xml#L4546
<<snip>>
For UDP service, <code>ovn-controller</code> sends a UDP packet to
the service and doesn't expect any reply. If it receives an ICMP
reply, then it considers the service to be <code>offline</code>.
<</snip>>

Thanks
Numan


> ---
>  controller/pinctrl.c | 9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/controller/pinctrl.c b/controller/pinctrl.c
> index 38e8590af..8226ad868 100644
> --- a/controller/pinctrl.c
> +++ b/controller/pinctrl.c
> @@ -7526,13 +7526,8 @@ svc_monitors_run(struct rconn *swconn,
>
>          case SVC_MON_S_WAITING:
>              if (current_time > svc_mon->wait_time) {
> -                if (svc_mon->protocol ==  SVC_MON_PROTO_TCP) {
> -                    svc_mon->n_failures++;
> -                    svc_mon->state = SVC_MON_S_OFFLINE;
> -                } else {
> -                    svc_mon->n_success++;
> -                    svc_mon->state = SVC_MON_S_ONLINE;
> -                }
> +                svc_mon->n_failures++;
> +                svc_mon->state = SVC_MON_S_OFFLINE;
>                  svc_mon->next_send_time = current_time + svc_mon->interval;
>                  next_run_time = svc_mon->next_send_time;
>              } else {
> --
> 2.27.0
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
diff mbox series

Patch

diff --git a/controller/pinctrl.c b/controller/pinctrl.c
index 38e8590af..8226ad868 100644
--- a/controller/pinctrl.c
+++ b/controller/pinctrl.c
@@ -7526,13 +7526,8 @@  svc_monitors_run(struct rconn *swconn,
 
         case SVC_MON_S_WAITING:
             if (current_time > svc_mon->wait_time) {
-                if (svc_mon->protocol ==  SVC_MON_PROTO_TCP) {
-                    svc_mon->n_failures++;
-                    svc_mon->state = SVC_MON_S_OFFLINE;
-                } else {
-                    svc_mon->n_success++;
-                    svc_mon->state = SVC_MON_S_ONLINE;
-                }
+                svc_mon->n_failures++;
+                svc_mon->state = SVC_MON_S_OFFLINE;
                 svc_mon->next_send_time = current_time + svc_mon->interval;
                 next_run_time = svc_mon->next_send_time;
             } else {