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

DNS Ping Proposal #559

Merged
merged 8 commits into from
Apr 11, 2023
Merged

DNS Ping Proposal #559

merged 8 commits into from
Apr 11, 2023

Conversation

bretambrose
Copy link
Contributor

@bretambrose bretambrose commented Apr 6, 2023

aws/aws-iot-device-sdk-python-v2#399

A set of changes designed to allow us to safely disable the DNS "pinging" functionality on a per-connection basis, while keeping the changes uncoupled to the particulars of the conditionally-undesired behavior and leaving default behavior unchanged.

  • Moves host resolution time from system clock to high res clock
  • Removes DNS host listener functionality completely. It is no longer used as of Multiple Bucket Support aws-c-s3#136
  • Un-entangle max-ttl from the DNS refresh frequency.
    • Add support for customizing resolve frequency.
    • Rework inner resolver thread exit condition to reflect these changes.
  • Host resolution configuration can now be overridden at connection kick off time
  • Make DNS TTL test more reliable by using a mock clock

Follow-up PRs in aws-c-http and aws-c-mqtt add host resolution override support to their public connection establishment options:

Aws-c-mqtt PR also uses the host resolution override to, by default, disable all unsolicited DNS queries when using MQTT, either directly or over websockets.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@bretambrose bretambrose changed the title WIP DNS Ping Proposal Apr 6, 2023
@codecov-commenter
Copy link

codecov-commenter commented Apr 6, 2023

Codecov Report

Patch coverage: 94.44% and project coverage change: -0.24 ⚠️

Comparison is base (8c24d7e) 79.33% compared to head (82a444e) 79.09%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #559      +/-   ##
==========================================
- Coverage   79.33%   79.09%   -0.24%     
==========================================
  Files          25       25              
  Lines        5646     5478     -168     
==========================================
- Hits         4479     4333     -146     
+ Misses       1167     1145      -22     
Impacted Files Coverage Δ
source/channel_bootstrap.c 72.74% <75.00%> (-0.08%) ⬇️
source/host_resolver.c 90.23% <100.00%> (+0.83%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@bretambrose bretambrose marked this pull request as ready for review April 7, 2023 15:05
Copy link
Contributor

@TwistedTwigleg TwistedTwigleg left a comment

Choose a reason for hiding this comment

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

Looks good to me. 👍

@DmitriyMusatkin
Copy link
Contributor

Removes DNS host listener functionality completely. It is no longer used since S3 endpoint DNS now returns large groups of records

Is this assertion true? from testing it seems that MVA DNS for s3 now returns a max of 8 ips and for 100 gbps nics min amount of ips we want is around 10. Will this cause perf degradation since we are not acquiring enough ips?

@@ -20,6 +20,7 @@
#include <inttypes.h>

const uint64_t NS_PER_SEC = 1000000000;
const size_t AWS_DEFAULT_DNS_TTL = 30;
Copy link
Contributor

Choose a reason for hiding this comment

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

i know this is not a new constant introduced by this code, but why 30? a lot of aws services ive seen use at least 60. are we refreshing dns too much with default config?

Copy link
Contributor Author

@bretambrose bretambrose Apr 10, 2023

Choose a reason for hiding this comment

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

I don't recall what, if any, reasons were behind the original choice.

@bretambrose
Copy link
Contributor Author

Removes DNS host listener functionality completely. It is no longer used since S3 endpoint DNS now returns large groups of records

Is this assertion true? from testing it seems that MVA DNS for s3 now returns a max of 8 ips and for 100 gbps nics min amount of ips we want is around 10. Will this cause perf degradation since we are not acquiring enough ips?

Assertion was incorrect about root reason. host listener functionality was removed far earlier here: awslabs/aws-c-s3#136

Will update PR commentary, but s3 client will be unaffected

Copy link
Contributor

@JonathanHenson JonathanHenson left a comment

Choose a reason for hiding this comment

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

discussed in my office hours, We can move the host resolver config init function to return an instance via value since it's trivially copyable and constructable.

The cvar wakeup can go outside the mutex lock/unlock. Otherwise looks good to me. Fix and ship.

@bretambrose bretambrose merged commit ef92ffa into main Apr 11, 2023
@bretambrose bretambrose deleted the ResolutionOverride branch April 11, 2023 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants