From 68bfa6ec63a3262766b74a44a215b1de21112905 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Tue, 29 Nov 2022 10:27:55 +0100 Subject: [PATCH] WIP: Remove quota on outgoing sockets from dispatch --- lib/dns/dispatch.c | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/lib/dns/dispatch.c b/lib/dns/dispatch.c index 246d0acdd8..b7a94e82a3 100644 --- a/lib/dns/dispatch.c +++ b/lib/dns/dispatch.c @@ -156,26 +156,6 @@ struct dns_dispatch { #define DNS_DISPATCHMGR_MAGIC ISC_MAGIC('D', 'M', 'g', 'r') #define VALID_DISPATCHMGR(e) ISC_MAGIC_VALID((e), DNS_DISPATCHMGR_MAGIC) -/*% - * Quota to control the number of UDP dispatch sockets. If a dispatch has - * more than the quota of sockets, new queries will purge oldest ones, so - * that a massive number of outstanding queries won't prevent subsequent - * queries (especially if the older ones take longer time and result in - * timeout). - */ -#ifndef DNS_DISPATCH_SOCKSQUOTA -#define DNS_DISPATCH_SOCKSQUOTA 3072 -#endif /* ifndef DNS_DISPATCH_SOCKSQUOTA */ - -/*% - * Quota to control the number of concurrent requests that can be handled - * by each TCP dispatch. (UDP dispatches do not currently support socket - * sharing.) - */ -#ifndef DNS_DISPATCH_MAXREQUESTS -#define DNS_DISPATCH_MAXREQUESTS 32768 -#endif /* ifndef DNS_DISPATCH_MAXREQUESTS */ - /*% * Number of buckets in the QID hash table, and the value to * increment the QID by when attempting to avoid collisions. @@ -1420,29 +1400,8 @@ dns_dispatch_add(dns_dispatch_t *disp, unsigned int options, LOCK(&disp->lock); - if (disp->requests >= DNS_DISPATCH_MAXREQUESTS) { - UNLOCK(&disp->lock); - return (ISC_R_QUOTA); - } - qid = disp->mgr->qid; - if (disp->socktype == isc_socktype_udp && - disp->nsockets > DNS_DISPATCH_SOCKSQUOTA) - { - dns_dispentry_t *oldest = NULL; - - /* - * Kill oldest outstanding query if the number of sockets - * exceeds the quota to keep the room for new queries. - */ - oldest = ISC_LIST_HEAD(disp->active); - if (oldest != NULL) { - oldest_response = oldest->response; - inc_stats(disp->mgr, dns_resstatscounter_dispabort); - } - } - res = isc_mem_get(disp->mgr->mctx, sizeof(*res)); *res = (dns_dispentry_t){ .port = localport,