This is the mail archive of the
mailing list for the glibc project.
[Bug libc/3675] New: libc caches resolv.conf forever
- From: "matthias dot andree at gmx dot de" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 7 Dec 2006 14:38:28 -0000
- Subject: [Bug libc/3675] New: libc caches resolv.conf forever
- Reply-to: sourceware-bugzilla at sourceware dot org
Relevant libc extension: BIND-8.2.3-T5B
libc apparently reads /etc/resolv.conf upon the first access to getaddrinfo()
and parses it and continues with the parsed results forever, even if
/etc/resolv.conf changes. There is no documented interface to cause libc to
re-read the resolv.conf file.
Real-world problem: Processes designed to run for many days will not detect
resolv.conf changes. On systems without permanent internet connection,
resolv.conf may be rewritten by unrelated DHCP client or PPP peer software after
an application using getaddrinfo() has started. The result is that errors such
as EAI_AGAIN that stem from stale /etc/resolv.conf parsed at application
start-up time persist until the application terminates.
Suggested solution: be sure to check /etc/resolv.conf for changes and, when
changes are detected, re-parse it every few (say, 5) seconds, or when EAI_AGAIN
would be returned. The time limit should bound the amount of time spent parsing
said fail without introducing too much delay WRT picking up changes.
Checking for resolv.conf changes upon EAI_AGAIN is clearly my favorite.
Summary: libc caches resolv.conf forever
AssignedTo: drepper at redhat dot com
ReportedBy: matthias dot andree at gmx dot de
CC: glibc-bugs at sources dot redhat dot com
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.