This is an automated email from the ASF dual-hosted git repository.
spacewander pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git
The following commit(s) were added to refs/heads/master by this push:
new df4b991d1 change(etcd): the health_check_retry should be named as
startup_retry (#7304)
df4b991d1 is described below
commit df4b991d1c19566e6c6385d36a105fb8a332ea0c
Author: 罗泽轩 <[email protected]>
AuthorDate: Thu Jun 23 09:48:16 2022 +0800
change(etcd): the health_check_retry should be named as startup_retry
(#7304)
As it only affects the startup.
Signed-off-by: spacewander <[email protected]>
---
apisix/cli/etcd.lua | 6 ++++--
conf/config-default.yaml | 2 +-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/apisix/cli/etcd.lua b/apisix/cli/etcd.lua
index 9edfbcd51..43aa4f84a 100644
--- a/apisix/cli/etcd.lua
+++ b/apisix/cli/etcd.lua
@@ -197,8 +197,10 @@ function _M.init(env, args)
local res, err
local retry_time = 0
- local health_check_retry = tonumber(yaml_conf.etcd.health_check_retry)
or 2
- while retry_time < health_check_retry do
+ local etcd = yaml_conf.etcd
+ -- TODO: remove deprecated health_check_retry option in APISIX v3
+ local max_retry = tonumber(etcd.startup_retry or
etcd.health_check_retry) or 2
+ while retry_time < max_retry do
res, err = request(version_url, yaml_conf)
-- In case of failure, request returns nil followed by an error
message.
-- Else the first return value is the response body
diff --git a/conf/config-default.yaml b/conf/config-default.yaml
index 2ed8c7e43..f35ec65b0 100644
--- a/conf/config-default.yaml
+++ b/conf/config-default.yaml
@@ -284,7 +284,7 @@ etcd:
timeout: 30 # 30 seconds
#resync_delay: 5 # when sync failed and a rest is needed,
resync after the configured seconds plus 50% random jitter
#health_check_timeout: 10 # etcd retry the unhealthy nodes after the
configured seconds
- health_check_retry: 2 # etcd retry time that only affects the
health check, default 2
+ startup_retry: 2 # the number of retry to etcd during the
startup, default to 2
#user: root # root username for etcd
#password: 5tHkHhYkjr6cQY # root password for etcd
tls: