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

[backport -> release/3.2.x] fix(dns): Eliminate asynchronous timer in syncQuery() to prevent hang #12104

Merged
merged 2 commits into from
Nov 29, 2023

Conversation

chobits
Copy link
Contributor

@chobits chobits commented Nov 28, 2023

backport #11900 and #11386 to 3.2.x

@chobits chobits force-pushed the backport-11900-to-release/3.2.x branch 2 times, most recently from 6d61d7e to c757b54 Compare November 28, 2023 10:18
hanshuebner and others added 2 commits November 29, 2023 16:27
- Stop retrying in dns/client.lua, let the resolver handle this.  This
   change also makes it possible to disable retries, which previously
   was not possible
 - Be more faithful to the timeouts set by the user.  Previously, the
   timeout configured was used only for the ultimate request sent to
   the DNS server, but asynchronous requests allowed longer timeouts
   which was not transparent.
 - When the DNS server fails, stop trying other query types.  Previously,
   the behavior was such that after an (intermediate) failure to query
   for one record type (say "SRV"), the client would try the next record
   type (say "A") and succeed with that.  It would then return the
   contents of the "A" record even if the "SRV" record pointed to a
   different address.
 - Change domain names used for testing the DNS client into the
   kong-gateway-testing.link zone, which is controlled by the Kong Gateway
   team.

Fixes #10182
KAG-2300
…adlock risk (#11900)

* fix(dns): introduce the synchronous query in syncQuery() to prevent hang risk

Originally the first request to `syncQuery()` will trigger an asynchronous timer
event, which added the risk of thread pool hanging.

With this patch, cold synchronously DNS query will always happen in the current
thread if current phase supports yielding.

Fix FTI-5348

---------

Co-authored-by: Datong Sun <datong.sun@konghq.com>
@chobits chobits force-pushed the backport-11900-to-release/3.2.x branch from c757b54 to 9641125 Compare November 29, 2023 08:27
@chobits
Copy link
Contributor Author

chobits commented Nov 29, 2023

After we merged this #12031, we can rebase this branch with the latest release 3.2.x.

@dndx dndx merged commit b65123b into release/3.2.x Nov 29, 2023
22 checks passed
@dndx dndx deleted the backport-11900-to-release/3.2.x branch November 29, 2023 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants