From f7c5a63628cbe8aac60adb8250f29623bbca232c Mon Sep 17 00:00:00 2001 From: Alex Rousskov Date: Thu, 15 Sep 2011 12:16:59 -0600 Subject: [PATCH] Do not let cache manager requests kill SMP Squid using isOpen() assertion. As the comment above the close call implies, we have not imported the foreign socket descriptor into our fd_table yet. We must use raw close(2), just like the corresponding Mgr::Request::Request(msg) code that allocates request.conn, uses raw assignment to give that half-baked connection a descriptor. TODO: This direct manipulation of Connection::fd is ugly, and this half-baked connection will most likely cause more [hidden] problems down the road. For example, Mgr::Request destructor will assert in a similar way if the request object is destroyed before Action::respond() is called. --- src/mgr/Action.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mgr/Action.cc b/src/mgr/Action.cc index 5fa0e4ba79..44b88a4b3c 100644 --- a/src/mgr/Action.cc +++ b/src/mgr/Action.cc @@ -70,7 +70,8 @@ Mgr::Action::respond(const Request& request) // Assume most kid classes are fully aggregatable (i.e., they do not dump // local info at all). Do not import the remote HTTP fd into our Comm // space; collect and send an IPC msg with collected info to Coordinator. - request.conn->close(); + ::close(request.conn->fd); + request.conn->fd = -1; collect(); sendResponse(request.requestId); } -- 2.47.2