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

In DNS service watcher, re-resolve every $TTL #181

Open
tomfitzhenry opened this issue Apr 8, 2016 · 1 comment
Open

In DNS service watcher, re-resolve every $TTL #181

tomfitzhenry opened this issue Apr 8, 2016 · 1 comment

Comments

@tomfitzhenry
Copy link
Contributor

The DNS service watcher will re-resolve every check_interval seconds. Rather than having to set check_interval, and possibly setting it too high/low, it would be nice if it re-resolved every $TTL (whatever the returned TTL is).

@tomfitzhenry
Copy link
Contributor Author

I can think of three approaches for this:

  1. For each server in @discovery['servers'], start a new watcher thread that does DNS resolution for that server, and sleeps for $TTL.
  2. Start a single watcher thread that does DNS resolution for all servers, and sleeps for the minimum across all TTLs, before re-resolving them all.
  3. Start a single watcher thread that does DNS resolution for all servers, and sleeps for the smallest TTL, then re-resolving the expired DNS record, then sleeps for whatever the smallest TTL is (maybe the same server, maybe another one),

The problem with (1) is that for N servers, there are N threads. This might be a problem for users if N is large.

The problem with (2) is that if N is large, we'll be doing a lot of resolving.

The problem with (3) is the code is trickier, but I'll give it a go.

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

No branches or pull requests

1 participant