Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion lib/resty/etcd/v3.lua
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ local function _request_uri(self, method, uri, opts, timeout, ignore_auth)
end
else
local max_retry = #self.endpoints * health_check.conf.max_fails + 1
for _ = 1, max_retry do
for i = 1, max_retry do
res, err = http_request_uri(self, http_cli, method, uri, body, headers, keepalive)
if err then
if err == "has no healthy etcd endpoint available" then
Expand All @@ -152,9 +152,16 @@ local function _request_uri(self, method, uri, opts, timeout, ignore_auth)
else
break
end
if i == max_retry then
return nil, err
end
end
end

if not res then
return nil, "request etcd get nil response"
end

if not typeof.string(res.body) then
return res
end
Expand Down