]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorAndreas Gustafsson <source@isc.org>
Wed, 11 Jul 2001 01:23:56 +0000 (01:23 +0000)
committerAndreas Gustafsson <source@isc.org>
Wed, 11 Jul 2001 01:23:56 +0000 (01:23 +0000)
 926.   [bug]           The resolver could deadlock with the ADB when
                        shutting down (multithreaded builds only).
                        [RT #1324]

CHANGES
lib/dns/resolver.c

diff --git a/CHANGES b/CHANGES
index 90f7da4d8a3397544c079ffc1e116e7e698caf74..08088df2943dad3eccb61151687b4856d46de2b8 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,8 @@
 
+ 926.  [bug]           The resolver could deadlock with the ADB when
+                       shutting down (multithreaded builds only).
+                       [RT #1324]
+
  924.  [port]          Extend support for pre-RFC2133 IPv6 implementation.
                        [RT #987]
 
index a1d371e86d6d9b3308f323f39723f3791d691431..1ac71d425aad433fd971f19a942ff0cb8e1cc720 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: resolver.c,v 1.187.2.10 2001/05/29 23:07:33 bwelling Exp $ */
+/* $Id: resolver.c,v 1.187.2.11 2001/07/11 01:23:56 gson Exp $ */
 
 #include <config.h>
 
@@ -1886,6 +1886,13 @@ fctx_doshutdown(isc_task_t *task, isc_event_t *event) {
                validator = ISC_LIST_NEXT(validator, link);
        }
 
+       /*
+        * Shut down anything that is still running on behalf of this
+        * fetch.  To avoid deadlock with the ADB, we must do this
+        * before we lock the bucket lock.
+        */
+       fctx_stopeverything(fctx, ISC_FALSE);
+
        LOCK(&res->buckets[bucketnum].lock);
 
        INSIST(fctx->state == fetchstate_active ||
@@ -1893,7 +1900,6 @@ fctx_doshutdown(isc_task_t *task, isc_event_t *event) {
        INSIST(fctx->want_shutdown);
 
        if (fctx->state != fetchstate_done) {
-               fctx_stopeverything(fctx, ISC_FALSE);
                fctx->state = fetchstate_done;
                fctx_sendevents(fctx, ISC_R_CANCELED);
        }