Commit a1b18e5
authored
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->
Add an optional in-memory `HickoryDnsResolver` to `aws-smithy-runtime`.
This is mostly targeted at supporting customers on AL2023 since it has
disabled OS level DNS caching by default. Hyper relies on OS DNS caching
if no DNS resolver is provided and this has led to some DNS throttling
for users. See links below for examples:
*
https://www.madebymikal.com/amazon-linux-2023-dns-and-systemd-resolved-a-story-of-no-caching/
*
https://repost.aws/questions/QUXJ5yuiRpQE2c2Htf4Dc9iA/dns-caching-in-amazon-linux-2023
* https://repost.aws/knowledge-center/dns-resolution-failures-ec2-linux
We leverage the
[hickory-resolver](https://crates.io/crates/hickory-resolver) crate to
provide this functionality.
## Description
<!--- Describe your changes in detail -->
Add new `HickoryDnsResolver` under `aws_smithy_dns`. This wraps a
`hickory_resolver::Resolver` and provides some minimal configuration
options (timeouts, retries, etc.) that seem unlikely to ever go away
even though the `hickory-dns` ecosystem is still pre-1x.
## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->
Added new integration tests at `tests/hickory.rs`. These tests spin up
an in-process DNS server on a random port and query it over `localhost`.
Had to fix `CrateSetTest.kt` since the TOML library we use in Kotlin
won't parse Cargo.toml files with `cfg` statements like
`[target.'cfg(not(target_family = "wasm"))'.dependencies]`. I had to add
one of those statements to prevent `hickory-resolver` from being
compiled for WASM targets since it was introducing a tokio feature that
caused compilation to fail and that caused `aws-smithy-runtime` to fail
in the stability test.
## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] For changes to the smithy-rs codegen or runtime crates, I have
created a changelog entry Markdown file in the `.changelog` directory,
specifying "client," "server," or both in the `applies_to` key.
----
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
1 parent abeb550 commit a1b18e5
File tree
15 files changed
+1896
-83
lines changed- .changelog
- aws
- rust-runtime
- aws-config
- sdk
- buildSrc/src
- main/kotlin
- test/kotlin
- rust-runtime
- aws-smithy-dns
- src
- tests
- tools/ci-scripts
15 files changed
+1896
-83
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments