2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 05:57:52 +00:00

avoid deadlock with the ADB when shutting down [RT #1324]

This commit is contained in:
Bob Halley 2001-07-11 01:19:56 +00:00
parent faca6b801d
commit c54210716e
2 changed files with 12 additions and 2 deletions

View File

@ -1,4 +1,8 @@
926. [bug] The resolver could deadlock with the ADB when
shutting down (multithreaded builds only).
[RT #1324]
925. [cleanup] Remove openssl from the distribution; require that
--with-openssl be specified if DNSSEC is needed.

View File

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: resolver.c,v 1.217 2001/06/04 19:33:09 tale Exp $ */
/* $Id: resolver.c,v 1.218 2001/07/11 01:19:56 halley Exp $ */
#include <config.h>
@ -1959,6 +1959,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 ||
@ -1966,7 +1973,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);
}