Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ngx_http_reqstat_module 健康检查计数在 reload 之后值变得不正确 #1961

Open
fbwfbi opened this issue Sep 19, 2024 · 1 comment

Comments

@fbwfbi
Copy link

fbwfbi commented Sep 19, 2024

Ⅰ. Issue Description

健康检查统计计数不正确

Ⅱ. Describe what happened

准备两个不同名称的 upstream 块,但是里面的 server 地址端口一样,指向同一个 RS,健康检查条件一致;
将其中一个 upstream 的健康检查条件改变,使其显示 RS down;而另一个 upstream 显示 RS up,其中 rise_count 记为 N;
将上一步被改变的 upstream 的健康检查条件恢复原样,reload nginx,其管理的 RS 显示为 up,但 rise_count 瞬间变成 N;

Ⅲ. Describe what you expected to happen

每个 upstream 的健康检查的状态应该互相独立,独立计数,不应该互相干扰

Ⅳ. How to reproduce it (as minimally and precisely as possible)

  1. 准备两个不同名称的 upstream,内容一样如下:
    upstream backend-service {
        server 10.0.0.18:80  max_fails=1 fail_timeout=10;
        check interval=5000 rise=1 fall=3 timeout=10000 type=http;	
        check_http_send "GET /test HTTP/1.1 \r\nHOST:test.com\r\n\r\n\r\n";
        check_http_expect_alive http_2xx http_3xx; 
    }

    upstream backend-service2 {
        server 10.0.0.18:80  max_fails=1 fail_timeout=10;
        check interval=5000 rise=1 fall=3 timeout=10000 type=http;	
        check_http_send "GET /test HTTP/1.1\r\nHOST:test.com\r\n\r\n\r\n";
        check_http_expect_alive http_2xx http_3xx; 
    }
  1. 其中的 RS 10.0.0.18:80 正常返回 200 响应,启动 Nginx 后,两者的健康检查状态一致如下:
    image

  2. 将 backend-service2 中的条件改成 check_http_expect_alive http_3xx; 再次 reload Nginx
    image

  3. 将 backend-service2 中的条件改回到原来的 check_http_expect_alive http_2xx http_3xx; 再次 reload Nginx
    image

  4. backend-service2 中的 RS rise_count 瞬间变得跟 backend-service 中的值一样

Ⅴ. Anything else we need to know?

Ⅵ. Environment:

  • Tengine version (use sbin/nginx -V): 3.1.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@fbwfbi and others