]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
In resume_qmin check if the fetch context is already shutting down - if so, try to...
authorWitold Kręcicki <wpk@isc.org>
Fri, 29 Mar 2019 13:30:40 +0000 (14:30 +0100)
committerWitold Kręcicki <wpk@isc.org>
Wed, 3 Apr 2019 14:34:33 +0000 (16:34 +0200)
(cherry picked from commit 7c960e89eac2fae57c4c732559d5c8d6db44d65a)

lib/dns/resolver.c

index e7567852d69247dee57526e3f86a0dcc5af0c19c..3241edb75fae6ccf7f03f5e376ef43788c933057 100644 (file)
@@ -4104,7 +4104,6 @@ resume_qmin(isc_task_t *task, isc_event_t *event) {
        fetchctx_t *fctx;
        isc_result_t result;
        bool bucket_empty;
-       bool locked = false;
        unsigned int bucketnum;
        unsigned int findoptions = 0;
        dns_name_t *fname, *dcname;
@@ -4137,6 +4136,11 @@ resume_qmin(isc_task_t *task, isc_event_t *event) {
 
        dns_resolver_destroyfetch(&fctx->qminfetch);
 
+       if (SHUTTINGDOWN(fctx)) {
+               maybe_destroy(fctx, false);
+               goto cleanup;
+       }
+
        /*
         * Note: fevent->rdataset must be disassociated and
         * isc_event_free(&event) be called before resuming
@@ -4219,8 +4223,7 @@ resume_qmin(isc_task_t *task, isc_event_t *event) {
  cleanup:
        INSIST(event == NULL);
        INSIST(fevent == NULL);
-       if (!locked)
-               LOCK(&res->buckets[bucketnum].lock);
+       LOCK(&res->buckets[bucketnum].lock);
        bucket_empty = fctx_decreference(fctx);
        UNLOCK(&res->buckets[bucketnum].lock);
        if (bucket_empty)