When canceling the last fetch, we also need to stop the fctx_expired
timer from possibly firing between the fctx_shutdown() call and the
fetch being actually destroyed along with the timer. As there are
multiple places where fctx_shutdown() is being called without stopping
the timer, move the fctx_stoptimer() to fctx_shutdown() and cleanup the
explicit usage.
fctx->qmin_warning = ISC_R_SUCCESS;
fctx_cancelqueries(fctx, no_response, age_untried);
- fctx_stoptimer(fctx);
LOCK(&res->buckets[fctx->bucketnum].lock);
FCTX_ATTR_CLR(fctx, FCTX_ATTR_ADDRWAIT);
* exit.
*/
if (fctx->state != fetchstate_init) {
+ fctx_stoptimer(fctx);
+
FCTXTRACE("posting control event");
cevent = &fctx->control_event;
isc_task_sendto(fctx->res->buckets[fctx->bucketnum].task,