spacewander commented on a change in pull request #4361:
URL: https://github.com/apache/apisix/pull/4361#discussion_r646389438
##########
File path: apisix/cli/etcd.lua
##########
@@ -191,10 +191,21 @@ function _M.init(env, args)
local version_url = host .. "/version"
local errmsg
- local 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
- -- and followed by the response status code.
+ local res, err
+ local retry_time = 0
+ while retry_time < 2 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
+ -- and followed by the response status code.
+ if res then
+ break
+ end
+ retry_time = retry_time + 1
+ print(str_format("Warning! Request etcd endpoint \'%s\' error, %s,
retry_time=%s",
+ version_url, err, retry_time))
Review comment:
Ping @yxudong
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]