dyrnq commented on issue #8856: URL: https://github.com/apache/apisix/issues/8856#issuecomment-1441306635
In this way, I started to modify and found a problem When the node health changes from healthy to unhealthy, Consul will find the update faster, while Apisix will finish the update more slowly. there is a test case ```bash while true; do echo -n "--->$(date)==="; curl --connect-timeout 1 --max-time 1 http://127.0.0.1:9080; echo "fetch healthy from consul"; curl -fsSL http://127.0.0.1:8500/v1/health/service/nginx?passing=true | jq -r '.[] | "\(.Service.Address):\(.Service.Port)"'; echo "dump from apisix ******" ; curl -fsL http://127.0.0.1:9090/v1/discovery/consul/dump | jq -r '.services."nginx"[] | "\(.host):\(.port)"'; sleep 1s; done ``` ```bash --->Thu Feb 23 15:23:19 CST 2023===nginx-4 fetch health from consul 192.168.33.4:18080 192.168.33.4:28080 192.168.33.4:48080 dump from apisix ****** 192.168.33.4:18080 192.168.33.4:28080 192.168.33.4:48080 --->Thu Feb 23 15:23:21 CST 2023===curl: (28) Operation timed out after 1002 milliseconds with 0 bytes received fetch health from consul 192.168.33.4:18080 192.168.33.4:28080 192.168.33.4:48080 dump from apisix ****** 192.168.33.4:18080 192.168.33.4:28080 192.168.33.4:48080 --->Thu Feb 23 15:23:23 CST 2023===curl: (28) Operation timed out after 1004 milliseconds with 0 bytes received fetch health from consul 192.168.33.4:18080 192.168.33.4:48080 dump from apisix ****** 192.168.33.4:18080 192.168.33.4:28080 192.168.33.4:48080 --->Thu Feb 23 15:23:25 CST 2023===nginx-1 fetch health from consul 192.168.33.4:18080 192.168.33.4:48080 dump from apisix ****** 192.168.33.4:18080 192.168.33.4:28080 192.168.33.4:48080 ``` Although consul also has a little delay, but apisix more obvious. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
