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

chore(dns) update dns client library #3220

Merged
merged 1 commit into from
Feb 26, 2018
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion kong-0.12.1-0.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies = {
"luaossl == 20171028",
"luasyslog == 1.0.0",
"lua_pack == 1.0.5",
"lua-resty-dns-client == 1.0.0",
"lua-resty-dns-client == 2.0.0",
"lua-resty-worker-events == 0.3.1",
"lua-resty-mediador == 0.1.2",
"lua-resty-healthcheck == 0.3.0",
Expand Down
3 changes: 2 additions & 1 deletion kong/core/balancer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,8 @@ local function execute(target)
hostname = target.host
if not ip then
log(ERR, "[dns] ", port, ". Tried: ", tostring(try_list))
if port == "dns server error: 3 name error" then
if port == "dns server error: 3 name error" or
port == "dns client error: 101 empty record received" then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Tieske A question, as I try to understand the relationship between lua-resty-dns-client and kong.core.balancer better: is there any other error (matching "dns .* error") returned in port that should not result in a name resolution failed error?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not if everything works as expected. But it could probably return db errors as well if a lookup for an upstream fails for some reason.

So these are the specific ones we catch to generate a 503. Others will be 500. (Top of mind answer, on mobile)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't read your question properly.

So these two errors listed in this change, are the only two where everything works as it should, yet we could not resolve.

So for example a dns server error is now reported as a 500.

Copy link
Contributor

@hishamhm hishamhm Feb 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So these two errors listed in this change, are the only two where everything works as it should, yet we could not resolve.

To check that I follow: this means that these are the cases where communication with Kong and the DNS server went well, but the name could not be resolved (because, for example, the name doesn't exist), and the other ones are cases include things like "DNS server is down", "DNS server replied badly formatted message" (these two being 'their' fault), "we couldn't open a socket" (this one being 'our' fault), etc.?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thank you for the clarification!

return nil, "name resolution failed", 503
end
end
Expand Down