diff mbox series

[ovs-dev] pinctrl: fix monitor state when using udp(icmp) to check healthy state

Message ID 20220721054017.23226-1-wangchuanlei@inspur.com
State Superseded
Headers show
Series [ovs-dev] pinctrl: fix monitor state when using udp(icmp) to check healthy state | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success

Commit Message

wangchuanlei July 21, 2022, 5:40 a.m. UTC
Hi,
    On my enviroment, i have a load-balancer, witch uses udp(icmp) protocol to check connection status between vip and backend.
    In normal cirsumstances, vip send request packet to backends , and backends send reply to vip, so the result of health check is online status. Then, i set the nic of backends vm to down state through command "ip link set eth0 down", in this case, the backends vm would't send reply to vip, but vip still send request to backends.In function svc_monitors_run, after sending request packet, state of vip would change to waiting, after 3 seconds, due to no reply packet, svc_mon->state change to SVC_MON_S_ONLINE, so, even no reply state keep on line. This is unreasonable, it should be offline.
    So this patch is to fix this bug!

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

Comments

Numan Siddique July 21, 2022, 4:36 p.m. UTC | #1
On Thu, Jul 21, 2022 at 12:40 AM wangchuanlei <wangchuanlei@inspur.com>
wrote:

> Hi,
>     On my enviroment, i have a load-balancer, witch uses udp(icmp)
> protocol to check connection status between vip and backend.
>     In normal cirsumstances, vip send request packet to backends , and
> backends send reply to vip, so the result of health check is online status.
> Then, i set the nic of backends vm to down state through command "ip link
> set eth0 down", in this case, the backends vm would't send reply to vip,
> but vip still send request to backends.In function svc_monitors_run, after
> sending request packet, state of vip would change to waiting, after 3
> seconds, due to no reply packet, svc_mon->state change to SVC_MON_S_ONLINE,
> so, even no reply state keep on line. This is unreasonable, it should be
> offline.
>     So this patch is to fix this bug!
>
> Signed-off-by: wangchuanlei <wangchuanlei@inspur.com>
>

Thanks for the patch.

Can you please format the commit message as per the guidelines here -
https://github.com/ovn-org/ovn/blob/main/Documentation/internals/contributing/submitting-patches.rst

Can also please drop "Hi" from the commit message.

Thanks
Numan


> ---
>  controller/pinctrl.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/controller/pinctrl.c b/controller/pinctrl.c
> index 38e8590af..1a21c7704 100644
> --- a/controller/pinctrl.c
> +++ b/controller/pinctrl.c
> @@ -7526,13 +7526,9 @@ 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..1a21c7704 100644
--- a/controller/pinctrl.c
+++ b/controller/pinctrl.c
@@ -7526,13 +7526,9 @@  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 {