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

Host name lookups are cached indefinitely #42

Open
BrianSipos opened this issue Feb 13, 2025 · 1 comment
Open

Host name lookups are cached indefinitely #42

BrianSipos opened this issue Feb 13, 2025 · 1 comment

Comments

@BrianSipos
Copy link
Contributor

When BP duct configuration or LTP sink/span configuration uses a host name instead of an IP address, the name is resolved to an address when it is first used and that result is effectively cached for the lifetime of that configuration.

This means that if the resolution changes (e.g. DNS/hostfile is updated, or a missing name is added to DNS/hostfile) during ION operational time the change will not ever be reflected back into ION operations. This is a problem, especially for the case where a host name does not exist at time of ION startup/config but will exist by the time actual traffic needs to use the duct/sink/span.

Either ION should not cache the name resolution directly (instead call the resolving API each time the address is needed) and rely on OS-level resolution caching, or ION should have some limited lifetime to its caching with control over when that lifetime expires. The first option is the most straightforward and used by other name-resolving applications.

@DavidEdell
Copy link
Contributor

Some additional details:

  • In ici/library/platform.c:getInternetAddress(), gethostbyname() can fail, in which case BAD_HOST_NAME is returned
    • Note: The gethostbyname() function is marked as deprecated in stdlib in favor of getaddrinfo (which would also support ipv6).
  • The BAD_HOST_NAME return code is never checked and ION will attempt to use that invalid value as an IP in future connections.

A third option would be for ION to re-evaluate its dns caching any time there is a connection error

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

2 participants