Send the ns_query_cancel() on the recursing clients when we initiate the
named shutdown for faster shutdown.
When we are shutting down the resolver, we cancel all the outstanding
fetches, and the ISC_R_CANCEL events doesn't propagate to the ns_client
callback.
In the future, the better solution how to fix this would be to look at
the shutdown paths and let them all propagate from bottom (loopmgr) to
top (f.e. ns_client).
(cherry picked from commit
d861d403bb9a7912e29a06aba6caf6d502839f1b)
return (result);
}
+void
+ns_clientmgr_shutdown(ns_clientmgr_t *manager) {
+ REQUIRE(VALID_MANAGER(manager));
+
+ LOCK(&manager->reclock);
+ for (ns_client_t *client = ISC_LIST_HEAD(manager->recursing);
+ client != NULL; client = ISC_LIST_NEXT(client, rlink))
+ {
+ ns_query_cancel(client);
+ }
+ UNLOCK(&manager->reclock);
+}
+
void
ns_clientmgr_destroy(ns_clientmgr_t **managerp) {
isc_result_t result;
*/
void
-ns_clientmgr_destroy(ns_clientmgr_t **managerp);
+ns_clientmgr_shutdown(ns_clientmgr_t *manager);
/*%<
- * Destroy a client manager and all ns_client_t objects
+ * Shutdown a client manager and all ns_client_t objects
* managed by it.
*/
+void
+ns_clientmgr_destroy(ns_clientmgr_t **managerp);
+/*%<
+ * Destroy a client manager.
+ */
+
isc_sockaddr_t *
ns_client_getsockaddr(ns_client_t *client);
/*%<
isc_nmsocket_close(&ifp->tcplistensocket);
}
if (ifp->clientmgr != NULL) {
+ ns_clientmgr_shutdown(ifp->clientmgr);
ns_clientmgr_destroy(&ifp->clientmgr);
}
}
ns_client_sourceip
ns_clientmgr_create
ns_clientmgr_destroy
+ns_clientmgr_shutdown
ns_hook_add
ns_hooktable_create
ns_hooktable_free