From: Alex Rousskov Date: Wed, 21 Sep 2011 18:07:29 +0000 (-0600) Subject: Temporary fix: Avoid killing Coordinator with unregistered cache mgr actions X-Git-Tag: take09 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c64e5b4a2072d3114cb3bbdc047fc29caaccb1bb;p=thirdparty%2Fsquid.git Temporary fix: Avoid killing Coordinator with unregistered cache mgr actions that cause isOpen() assertions. Same as trunk r11748. --- diff --git a/src/ipc/Coordinator.cc b/src/ipc/Coordinator.cc index 6379f4b59e..7bc106ffce 100644 --- a/src/ipc/Coordinator.cc +++ b/src/ipc/Coordinator.cc @@ -164,15 +164,26 @@ Ipc::Coordinator::handleCacheMgrRequest(const Mgr::Request& request) { debugs(54, 4, HERE); + try { + Mgr::Action::Pointer action = + CacheManager::GetInstance()->createRequestedAction(request.params); + AsyncJob::Start(new Mgr::Inquirer(action, request, strands_)); + } + catch (const std::exception &ex) { + debugs(54, DBG_IMPORTANT, "BUG: cannot aggregate mgr:" << + request.params.actionName << ": " << ex.what()); + // TODO: Avoid half-baked Connections or teach them how to close. + ::close(request.conn->fd); + request.conn->fd = -1; + return; // the worker will timeout and close + } + // Let the strand know that we are now responsible for handling the request Mgr::Response response(request.requestId); TypedMsgHdr message; response.pack(message); SendMessage(MakeAddr(strandAddrPfx, request.requestorId), message); - Mgr::Action::Pointer action = - CacheManager::GetInstance()->createRequestedAction(request.params); - AsyncJob::Start(new Mgr::Inquirer(action, request, strands_)); } void