alibaba / tengine

A distribution of Nginx with some advanced features
https://tengine.taobao.org
BSD 2-Clause "Simplified" License
12.65k stars 2.52k forks source link

使用tengine的dyups module做动态负载均衡时,Nginx升级到1.19.2以上后,dyups模块出现读body数据偶发不完整的问题 #1944

Open FengXingYuXin opened 1 week ago

FengXingYuXin commented 1 week ago

问题描述: 升级Nginx版本到1.25.3以后,Tengine dyups模块在更新upstream数据时,如果IP比较多,比如500个+,会出现dyups失败的现象。通过gdb调试,发现是dyups模块在ngx_http_dyups_read_body中没有读到完整的body数据导致。 追查了下Nginx相关changelog,发现在1.19.2中针对chunk相关做了很多优化,可以参考 https://github.com/nginx/nginx/commit/9edc93fe0ed60bac336d11f7d20d3c2ed9db3227#diff-2cd52ff90de8e452b238fca4c59dbd36268ad306bdc8a9eb30788e9d1963bfb4,优化中调整了body数据的处理方式,影响了dyups模块读body的正确性

FengXingYuXin commented 1 week ago

在dyups仓库中也有人提到过类似问题,但是没有看到下文描述,https://github.com/yzprofile/ngx_http_dyups_module/issues/140