tzssangglass commented on a change in pull request #5206:
URL: https://github.com/apache/apisix/pull/5206#discussion_r727249565



##########
File path: t/core/config_etcd.t
##########
@@ -57,6 +57,11 @@ apisix:
 etcd:
   host:
     - "https://127.0.0.1:2379";
+--- extra_init_by_lua
+local health_check = require("resty.etcd.health_check")
+health_check.get_target_status = function()

Review comment:
       In the lua-resty-etcd v1.5.5 implementation, there is no passive 
round-robin health check, so when apisix loads etcd configuration when apisix 
starts, 
here:https://github.com/apache/apisix/blob/c7523da7d45b674427205c435444133ff1aca258/apisix/init.lua#L84-L86
   even if it get `failed to load the configuration: closed`, then sync data 
from etcd in ngx.timer will still use `https://127.0.0.1:2379` as the etcd 
endpoint and get the `handshake failed`.
   
   but in lua-resty-etcd v1.6.0 implementation, the passive round-robin health 
check is default policy, so when apisix loads etcd configuration when apisix 
starts, `https://127.0.0.1:2379` is marked as unhealthy endpoint, and then sync 
data from etcd in ngx.timer would got `has no healthy etcd endpoint available` 
in `choose_endpoint` function, can not get the `handshake failed`.
   
   bypass `get_target_status` to simulate the behaviour of the original test 
case.

##########
File path: conf/config-default.yaml
##########
@@ -272,6 +272,7 @@ etcd:
 
     verify: true                  # whether to verify the etcd endpoint 
certificate when setup a TLS connection to etcd,
                                   # the default value is true, e.g. the 
certificate will be verified strictly.
+  #sni:                           # the SNI fot etcd TLS requests

Review comment:
       update




-- 
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]


Reply via email to