From: bert hubert Date: Thu, 6 Feb 2014 11:48:23 +0000 (+0100) Subject: make sure we don't exceed the number of available filedescriptors for mthreads. You... X-Git-Tag: rec-3.6.0-rc1~155 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36849ff24837084e3f4f0b232942d0cf31ea9f78;p=thirdparty%2Fpdns.git make sure we don't exceed the number of available filedescriptors for mthreads. You can still overshoot a little bit, but not all mthreads will be using an fd. Conflicts: pdns/misc.hh pdns/pdns_recursor.cc --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 3939448480..52a6e149ee 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -1614,20 +1614,27 @@ static void checkLinuxIPv6Limits() if(readFileIfThere("/proc/sys/net/ipv6/route/max_size", &line)) { int lim=atoi(line.c_str()); if(lim < 16384) { - L< availFDs) { + if(getFilenumLimit(true) >= g_maxMThreads * g_numThreads) { + setFilenumLimit(g_maxMThreads * g_numThreads); + L< availFDs) { - if(getFilenumLimit(true) >= g_maxMThreads * g_numThreads) { - setFilenumLimit(g_maxMThreads * g_numThreads); - L<