]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix logging when increasing client-per-query, for BIND 9.4.
authorShane Kerr <shane@isc.org>
Thu, 1 Nov 2007 13:13:24 +0000 (13:13 +0000)
committerShane Kerr <shane@isc.org>
Thu, 1 Nov 2007 13:13:24 +0000 (13:13 +0000)
See RT ticket #17236 for more.

CHANGES
lib/dns/resolver.c

diff --git a/CHANGES b/CHANGES
index c668a96cc9e76adf8db8adddee3364d6f7c698ec..e433e5771ff69aa22874a0122e48431c7bb4a8c9 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+2260.  [bug]           Reported wrong clients-per-query when increasing the
+                       value. [RT #17236]
 
        --- 9.4.2rc2 released ---
 
index e6986d01eb1175a0292c6922b7c037ccbfc93dc2..e6264be72a2e1db9ec976ee27d6ebe144e851ffb 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: resolver.c,v 1.284.18.64 2007/10/31 05:14:59 marka Exp $ */
+/* $Id: resolver.c,v 1.284.18.65 2007/11/01 13:13:24 shane Exp $ */
 
 /*! \file */
 
@@ -331,7 +331,7 @@ struct dns_resolver {
        isc_eventlist_t                 whenshutdown;
        unsigned int                    activebuckets;
        isc_boolean_t                   priming;
-       unsigned int                    spillat;
+       unsigned int                    spillat;        /* clients-per-query */
        /* Locked by primelock. */
        dns_fetch_t *                   primefetch;
        /* Locked by nlock. */
@@ -777,6 +777,9 @@ fctx_sendevents(fetchctx_t *fctx, isc_result_t result) {
        unsigned int count = 0;
        isc_interval_t i;
        isc_boolean_t logit = ISC_FALSE;
+       unsigned int old_spillat;
+       unsigned int new_spillat = 0;   /* initialized to silence compiler
+                                          warnings */
 
        /*
         * Caller must be holding the appropriate bucket lock.
@@ -819,23 +822,27 @@ fctx_sendevents(fetchctx_t *fctx, isc_result_t result) {
            (count < fctx->res->spillatmax || fctx->res->spillatmax == 0)) {
                LOCK(&fctx->res->lock);
                if (count == fctx->res->spillat && !fctx->res->exiting) {
+                       old_spillat = fctx->res->spillat;
                        fctx->res->spillat += 5;
                        if (fctx->res->spillat > fctx->res->spillatmax &&
                            fctx->res->spillatmax != 0)
                                fctx->res->spillat = fctx->res->spillatmax;
+                       new_spillat = fctx->res->spillat;
+                       if (new_spillat != old_spillat) {
+                               logit = ISC_TRUE;
+                       }
                        isc_interval_set(&i, 20 * 60, 0);
                        result = isc_timer_reset(fctx->res->spillattimer,
                                                 isc_timertype_ticker, NULL,
                                                 &i, ISC_TRUE);
                        RUNTIME_CHECK(result == ISC_R_SUCCESS);
-                       logit = ISC_TRUE;
                }
                UNLOCK(&fctx->res->lock);
                if (logit)
                        isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER,
                                      DNS_LOGMODULE_RESOLVER, ISC_LOG_NOTICE,
                                      "clients-per-query increased to %u",
-                                     count + 1);
+                                     new_spillat);
        }
 }