From 0aba3a66be37d6a32ce3d1029cbc3e39f19c115d Mon Sep 17 00:00:00 2001 From: Christos Tsantilas Date: Fri, 29 Aug 2014 09:59:17 +0300 Subject: [PATCH] Close active pconns after their *_port goes away on reconfigure. This change reduces what may be perceived as reconfigure memory leaks related to *_port options. Before this change, a single persistent connection could continue to receive new requests (and tie no longer globally accessible PortCfg-related structures) for hours. TODO: Close already idle pconns as well. --- src/client_side_reply.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/client_side_reply.cc b/src/client_side_reply.cc index fbbaf7997d..d8a5b95d0b 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -1519,6 +1519,10 @@ clientReplyContext::buildReplyHeader() // The peer wants to close the pinned connection debugs(88, 3, "pinned reply forces close"); request->flags.proxyKeepalive = false; + } else if (http->getConn() && http->getConn()->port->listenConn == NULL) { + // The listening port closed because of a reconfigure + debugs(88, 3, "listening port closed"); + request->flags.proxyKeepalive = false; } // Decide if we send chunked reply -- 2.47.3