kong icon indicating copy to clipboard operation
kong copied to clipboard

DNS keep retrying different qtypes on hard error(s) from DNS server

Open komapa opened this issue 2 years ago • 0 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Kong version ($ kong version)

Version 3.0.2

Current Behavior

By looking at the source code and also the end behavior, when DNS server is hard down, settings like RES_OPTIONS = "timeout:1 attempts:2" fail the request after 4s instead of 2s. This is because you try SRV first, that fails, and then you try A and that fails but each of these take 2s to fails, so total of 4s.

Expected Behavior

I would expect that if you get a hard error from DNS during SRV resolution, you should stop right there because even if the A query succeeds, you are actually doing the wrong thing because we want the SRV to be respected first. The A record will not work as intended and if you were to cache and try to serve that, you will be returning different type of errors that will be hard to debug.

Steps To Reproduce

No response

Anything else?

No response

komapa avatar Jan 27 '23 16:01 komapa