Bug #67422 | mysqld fails to switch DNS resolver if thread_cache_size > 0 | ||
---|---|---|---|
Submitted: | 30 Oct 2012 13:50 | ||
Reporter: | Leandro Morgado | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Options | Severity: | S3 (Non-critical) |
Version: | 5.5.28 | OS: | Linux |
Assigned to: | Marc ALFF | CPU Architecture: | Any |
[30 Oct 2012 13:50]
Leandro Morgado
[30 Oct 2012 14:01]
Leandro Morgado
The attached file contains a very detailed technical description of the tests made to find this bug.
Attachment: long_test_case_67422.txt (text/plain), 16.02 KiB.
[31 Oct 2012 3:34]
Davi Arnaut
In glibc the resolver state is thread-local and is initialized at the time of the first name resolution. This means that any thread will likely read the configuration files (resolv.conf) only once.
[31 Oct 2012 8:02]
Marc ALFF
Hi Davi. Yes, that would explain the behavior seen. Thanks for commenting on this. Regards, -- Marc
[16 Nov 2012 16:55]
Hartmut Holzgraefe
known glibc issue, see e.g. http://www.sourceware.org/ml/libc-alpha/2010-03/msg00021.html there are different patches around but none seem to have made it into glibc, or at least the 2.12 version used in CentOS 6.3, yet. Debian has merged the original patch though, so Debian, Ubuntu and other Debian-based distributions are not affected ... Strace shows that these on these distributions a stat(resolv.conf) is performed on every client connect, and if resolv.conf has changed it is re-read. With CentOS and unpatched libc i can only see a single open() on resolv.conf when the first client connects, then never again.
[16 Nov 2012 22:28]
Hartmut Holzgraefe
Adding a call to res_init() (on platforms where it is part of libc) at the very beginning of hostname_cache_refresh() seems to fix this
[7 Jan 2015 19:03]
MySQL Verification Team
Verified, but a problem is in glibc.