+3138. [bug] Address memory leaks and out-of-order operations when
+ shutting named down. [RT #25210]
+
3137. [func] Improve hardware scalability by allowing multiple
worker threads to process incoming UDP packets.
This can significantly increase query throughput
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: client.c,v 1.274 2011/07/28 04:04:36 each Exp $ */
+/* $Id: client.c,v 1.275 2011/07/28 04:27:26 marka Exp $ */
#include <config.h>
UNUSED(arg);
+ /*
+ * ns_g_server->interfacemgr is task exclusive locked.
+ */
+ if (ns_g_server->interfacemgr == NULL)
+ return (ISC_TRUE);
+
if (!ns_interfacemgr_listeningon(ns_g_server->interfacemgr, dstaddr))
return (ISC_FALSE);
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: xfrout.c,v 1.141 2011/03/10 23:47:49 tbox Exp $ */
+/* $Id: xfrout.c,v 1.142 2011/07/28 04:27:26 marka Exp $ */
#include <config.h>
CHECK(xfr->stream->methods->first(xfr->stream));
- if (xfr->tsigkey != NULL) {
+ if (xfr->tsigkey != NULL)
dns_name_format(&xfr->tsigkey->name, keyname, sizeof(keyname));
- } else
+ else
keyname[0] = '\0';
if (is_poll)
xfrout_log1(client, question_name, question_class,
xfr = isc_mem_get(mctx, sizeof(*xfr));
if (xfr == NULL)
return (ISC_R_NOMEMORY);
- xfr->mctx = mctx;
+ xfr->mctx = NULL;
+ isc_mem_attach(mctx, &xfr->mctx);
xfr->client = NULL;
ns_client_attach(client, &xfr->client);
xfr->id = id;
static void
xfrout_ctx_destroy(xfrout_ctx_t **xfrp) {
xfrout_ctx_t *xfr = *xfrp;
+ ns_client_t *client = NULL;
INSIST(xfr->sends == 0);
if (xfr->db != NULL)
dns_db_detach(&xfr->db);
+ /*
+ * We want to detch the client after we have released the memory
+ * context as ns_client_detach checks the memory reference count.
+ */
+ ns_client_attach(xfr->client, &client);
ns_client_detach(&xfr->client);
-
- isc_mem_put(xfr->mctx, xfr, sizeof(*xfr));
+ isc_mem_putanddetach(&xfr->mctx, xfr, sizeof(*xfr));
+ ns_client_detach(&client);
*xfrp = NULL;
}
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: socket.c,v 1.341 2011/07/28 04:04:37 each Exp $ */
+/* $Id: socket.c,v 1.342 2011/07/28 04:27:26 marka Exp $ */
/*! \file */
INSIST(sock->bound);
dev = allocate_socketevent(sock, ISC_SOCKEVENT_RECVDONE, action, arg);
- if (dev == NULL) {
+ if (dev == NULL)
return (ISC_R_NOMEMORY);
- }
/*
* UDP sockets are always partial read
INSIST(sock->bound);
dev = allocate_socketevent(sock, ISC_SOCKEVENT_SENDDONE, action, arg);
- if (dev == NULL) {
+ if (dev == NULL)
return (ISC_R_NOMEMORY);
- }
dev->region = *region;
REQUIRE(iocount > 0);
dev = allocate_socketevent(sock, ISC_SOCKEVENT_SENDDONE, action, arg);
- if (dev == NULL) {
+ if (dev == NULL)
return (ISC_R_NOMEMORY);
- }
/*
* Move each buffer from the passed in list to our internal one.
*/
isc_task_attach(task, &ntask);
if (isc_task_exiting(ntask)) {
+ free_socket(&nsock);
isc_task_detach(&ntask);
isc_event_free(ISC_EVENT_PTR(&dev));
UNLOCK(&sock->lock);
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: socket.c,v 1.88 2011/07/28 04:04:37 each Exp $ */
+/* $Id: socket.c,v 1.89 2011/07/28 04:27:27 marka Exp $ */
/* This code uses functions which are only available on Server 2003 and
* higher, and Windows XP and higher.
*/
isc_task_attach(task, &ntask);
if (isc_task_exiting(ntask)) {
+ free_socket(&nsock, __LINE__);
isc_task_detach(&ntask);
isc_event_free(ISC_EVENT_PTR(&adev));
UNLOCK(&sock->lock);