Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(balancer) do not send body from balancer ctx #2327

Merged
merged 1 commit into from
Apr 6, 2017
Merged
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
15 changes: 9 additions & 6 deletions kong/kong.lua
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,10 @@ function Kong.balancer()

local ok, err = balancer_execute(addr)
if not ok then
return responses.send_HTTP_INTERNAL_SERVER_ERROR("failed to retry the "..
"dns/balancer resolver for '"..addr.upstream.host..
"' with: "..tostring(err))
ngx.log(ngx.ERR, "failed to retry the dns/balancer resolver for ",
addr.upstream.host, "' with: ", tostring(err))

return responses.send(500)
end
else
-- first try, so set the max number of retries
Expand All @@ -236,9 +237,11 @@ function Kong.balancer()
-- set the targets as resolved
local ok, err = set_current_peer(addr.ip, addr.port)
if not ok then
ngx.log(ngx.ERR, "failed to set the current peer (address:'",
tostring(addr.ip),"' port:",tostring(addr.port),"): ", tostring(err))
return responses.send_HTTP_INTERNAL_SERVER_ERROR()
ngx.log(ngx.ERR, "failed to set the current peer (address: ",
tostring(addr.ip), " port: ", tostring(addr.port),"): ",
tostring(err))

return responses.send(500)
end

ok, err = set_timeouts(addr.connect_timeout / 1000,
Expand Down