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

client: read /etc/resolv.conf less often #296

Open
hannesm opened this issue Feb 3, 2022 · 0 comments
Open

client: read /etc/resolv.conf less often #296

hannesm opened this issue Feb 3, 2022 · 0 comments

Comments

@hannesm
Copy link
Member

hannesm commented Feb 3, 2022

When discussing #291 with @reynir, we figured that /etc/resolv.conf may be read rather often and its content being checksummed (using Digest.string --> MD5).

We thought about various solutions, all increasing the complexity:

  • remember a timestamp of the last read, and only re-read if at least 2 seconds have passed
  • remember the mtime of /etc/resolv.conf and only re-read if the mtime changed
    • this is brittle if /etc/resolv.conf is a symlink, thus we need to preserve its and linked-to-files paths and mtimes

It is not clear whether it is worth the effort and complexity, so we'll leave as is -- and if the current code turns out to be a bottleneck, we'll revise it.

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