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.1.x] fix(dns): Eliminate asynchronous timer in syncQuery() to prevent hang #12126

Closed
wants to merge 3 commits into from

Conversation

chobits
Copy link
Contributor

@chobits chobits commented Nov 30, 2023

backport #11900 and #11386 to 3.1.x

chobits and others added 3 commits November 30, 2023 16:04
This commit backports HTTP mocking to release/3.2.x, including the
following PRs from master branch: #10885, #11009, #11182 and #11331.
- 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 <[email protected]>
@chobits chobits requested a review from dndx November 30, 2023 08:07
@chobits chobits changed the title Backport 11900 to release/3.1.x [backport -> release/3.1.x] fix(dns): Eliminate asynchronous timer in syncQuery() to prevent hang Nov 30, 2023
@chobits
Copy link
Contributor Author

chobits commented Dec 4, 2023

THis pr is pending now, we only maintain kong ee 3.1.x.x now, kong ce 3.1.x was deprecated.

@chobits chobits closed this Dec 4, 2023
@chobits chobits deleted the backport-11900-to-release/3.1.x branch February 6, 2024 03:40
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.

2 participants