]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Log query and depth counters during fetches when querytrace is enabled (#41787)
authorMukund Sivaraman <muks@isc.org>
Fri, 4 Mar 2016 07:55:37 +0000 (13:25 +0530)
committerMukund Sivaraman <muks@isc.org>
Fri, 4 Mar 2016 08:00:12 +0000 (13:30 +0530)
(cherry picked from commit 275265ab27815d2261ebf68b48201fb7bffdf426)
(cherry picked from commit 666fa20ef3db1d9323b53ed0fa5584cf0f862a67)

CHANGES
lib/dns/resolver.c

diff --git a/CHANGES b/CHANGES
index 47589983a04fd66af22cf7639f3ba245dd98ce7c..8c99a2b431397a62b5f5dd8a380d78fd952fa131 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+4327.  [func]          Log query and depth counters during fetches when
+                       querytrace is enabled (helps in diagnosing).
+                       [RT #41787]
+
 4326.  [protocol]      Add support for AVC. [RT #41819]
 
 4324.  [bug]           When deleting records from a zone database, interior
index deb44e5400a7be773d71f3512b4df706e8bf2a14..5f75bc08396e0839013671e36ac716fdfc5eaa09 100644 (file)
                                      "fctx %p(%s): [result: %s] %s %s", \
                                      fctx, fctx->info, \
                                      isc_result_totext(res), (m1), (m2))
+#define FCTXTRACE5(m1, m2, v) \
+                       isc_log_write(dns_lctx, \
+                                     DNS_LOGCATEGORY_RESOLVER, \
+                                     DNS_LOGMODULE_RESOLVER, \
+                                     ISC_LOG_DEBUG(3), \
+                                     "fctx %p(%s): %s %s%u", \
+                                     fctx, fctx->info, (m1), (m2), (v))
 #define FTRACE(m)       isc_log_write(dns_lctx, \
                                      DNS_LOGCATEGORY_RESOLVER, \
                                      DNS_LOGMODULE_RESOLVER, \
 #define FCTXTRACE3(m1, res) do { UNUSED(m1); UNUSED(res); } while (0)
 #define FCTXTRACE4(m1, m2, res) \
        do { UNUSED(m1); UNUSED(m2); UNUSED(res); } while (0)
+#define FCTXTRACE5(m1, m2, v) \
+       do { UNUSED(m1); UNUSED(m2); UNUSED(v); } while (0)
 #define FTRACE(m) do { UNUSED(m); } while (0)
 #define QTRACE(m) do { UNUSED(m); } while (0)
 #endif /* WANT_QUERYTRACE */
@@ -2868,7 +2877,7 @@ fctx_getaddresses(fetchctx_t *fctx, isc_boolean_t badcache) {
        isc_boolean_t all_spilled = ISC_TRUE;
 #endif /* ENABLE_FETCHLIMIT */
 
-       FCTXTRACE("getaddresses");
+       FCTXTRACE5("getaddresses", "fctx->depth=", fctx->depth);
 
        /*
         * Don't pound on remote servers.  (Failsafe!)
@@ -2884,8 +2893,9 @@ fctx_getaddresses(fetchctx_t *fctx, isc_boolean_t badcache) {
        if (fctx->depth > res->maxdepth) {
                isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER,
                              DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(3),
-                             "too much NS indirection resolving '%s'",
-                             fctx->info);
+                             "too much NS indirection resolving '%s' "
+                             "(depth=%u, maxdepth=%u)",
+                             fctx->info, fctx->depth, res->maxdepth);
                return (DNS_R_SERVFAIL);
        }
 
@@ -3359,7 +3369,7 @@ fctx_try(fetchctx_t *fctx, isc_boolean_t retrying, isc_boolean_t badcache) {
        unsigned int bucketnum;
        isc_boolean_t bucket_empty;
 
-       FCTXTRACE("try");
+       FCTXTRACE5("try", "fctx->qc=", isc_counter_used(fctx->qc));
 
        REQUIRE(!ADDRWAIT(fctx));
 
@@ -3369,8 +3379,10 @@ fctx_try(fetchctx_t *fctx, isc_boolean_t retrying, isc_boolean_t badcache) {
        if (isc_counter_used(fctx->qc) > res->maxqueries) {
                isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER,
                              DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(3),
-                             "exceeded max queries resolving '%s'",
-                             fctx->info);
+                             "exceeded max queries resolving '%s' "
+                             "(querycount=%u, maxqueries=%u)",
+                             fctx->info,
+                             isc_counter_used(fctx->qc), res->maxqueries);
                fctx_done(fctx, DNS_R_SERVFAIL, __LINE__);
                return;
        }