From c960236adbf709c1068649159984abe13f54ceac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Fri, 7 Jan 2022 13:12:22 +0100 Subject: [PATCH] Don't schedule next zone events when shutting down When the named is shutting down, the zone event callbacks could re-schedule the stub and refresh events leading to assertion failure. Handle the ISC_R_SHUTTINGDOWN event state gracefully by bailing out. --- lib/dns/zone.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/dns/zone.c b/lib/dns/zone.c index d4a66ec5b5..26e41db45e 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -13607,6 +13607,8 @@ stub_callback(isc_task_t *task, isc_event_t *event) { switch (revent->result) { case ISC_R_SUCCESS: break; + case ISC_R_SHUTTINGDOWN: + goto exiting; case ISC_R_TIMEDOUT: if (!DNS_ZONE_FLAG(zone, DNS_ZONEFLG_NOEDNS)) { DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_NOEDNS); @@ -13988,6 +13990,8 @@ refresh_callback(isc_task_t *task, isc_event_t *event) { switch (revent->result) { case ISC_R_SUCCESS: break; + case ISC_R_SHUTTINGDOWN: + goto exiting; case ISC_R_TIMEDOUT: if (!DNS_ZONE_FLAG(zone, DNS_ZONEFLG_NOEDNS)) { DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_NOEDNS);