ERROR: Squid BUG: cannot aggregate mgr:userhash:
check failed: cmd->profile != nullptr
exception location: cache_manager.cc(102) createRequestedAction
Since 2010 commit
7de94c8c, only worker processes made RegisterAction()
calls associated with the affected cache manager reports. Coordinator
process needs these registrations as well because it uses Mgr::Action
code while iterating report-generating kids[^1].
When fixed Coordinator asks a disker process for an Action report, that
process must recognize the action as well (even when disker has no
information to supply) to avoid triggering similar Action lookup BUGs.
[^1]: Coordinator mostly needs Mgr::Action for stats aggregation, but
even non-aggregating actions (like the fixed three) need registered
Mgr::ActionProfile objects for Coordinator to know whether to aggregate.
/* DEBUG: section 39 Cache Array Routing Protocol */
#include "squid.h"
+#include "base/RunnersRegistry.h"
#include "CachePeer.h"
#include "CachePeers.h"
#include "carp.h"
Mgr::RegisterAction("carp", "CARP information", carpCachemgr, 0, 1);
}
-void
+static void
carpInit(void)
{
int W = 0;
CarpPeers().assign(rawCarpPeers.begin(), rawCarpPeers.end());
}
+/// reacts to RegisteredRunner events relevant to this module
+class CarpRr: public RegisteredRunner
+{
+public:
+ /* RegisteredRunner API */
+ void useConfig() override { carpInit(); }
+ void syncConfig() override { carpInit(); }
+};
+
+DefineRunnerRegistrator(CarpRr);
+
CachePeer *
carpSelectParent(PeerSelector *ps)
{
class CachePeer;
class PeerSelector;
-void carpInit(void);
CachePeer *carpSelectParent(PeerSelector *);
#endif /* SQUID_SRC_CARP_H */
#include "base/TextException.h"
#include "cache_cf.h"
#include "CachePeer.h"
-#include "carp.h"
#include "client_db.h"
#include "client_side.h"
#include "comm.h"
#include "parser/Tokenizer.h"
#include "Parsing.h"
#include "pconn.h"
-#include "peer_sourcehash.h"
-#include "peer_userhash.h"
#include "PeerSelectState.h"
#include "protos.h"
#include "redirect.h"
asnInit();
Acl::Node::Initialize();
peerSelectInit();
-
- carpInit();
-#if USE_AUTH
- peerUserHashInit();
-#endif
- peerSourceHashInit();
}
}
// RegisteredRunner event handlers should not depend on handler call order
// and, hence, should not depend on the registration call order below.
+ CallRunnerRegistrator(CarpRr);
CallRunnerRegistrator(ClientDbRr);
CallRunnerRegistrator(CollapsedForwardingRr);
CallRunnerRegistrator(MemStoreRr);
CallRunnerRegistrator(PeerPoolMgrsRr);
+ CallRunnerRegistrator(PeerSourceHashRr);
CallRunnerRegistrator(SharedMemPagesRr);
CallRunnerRegistrator(SharedSessionCacheRr);
CallRunnerRegistrator(TransientsRr);
CallRunnerRegistrator(NtlmAuthRr);
#endif
+#if USE_AUTH
+ CallRunnerRegistrator(PeerUserHashRr);
+#endif
+
#if USE_OPENSSL
CallRunnerRegistrator(sslBumpCfgRr);
#endif
/* DEBUG: section 39 Peer source hash based selection */
#include "squid.h"
+#include "base/RunnersRegistry.h"
#include "CachePeer.h"
#include "CachePeers.h"
#include "HttpRequest.h"
return (*p1)->weight - (*p2)->weight;
}
-void
+static void
peerSourceHashInit(void)
{
int W = 0;
SourceHashPeers().assign(rawSourceHashPeers.begin(), rawSourceHashPeers.end());
}
+/// reacts to RegisteredRunner events relevant to this module
+class PeerSourceHashRr: public RegisteredRunner
+{
+public:
+ /* RegisteredRunner API */
+ void useConfig() override { peerSourceHashInit(); }
+ void syncConfig() override { peerSourceHashInit(); }
+};
+
+DefineRunnerRegistrator(PeerSourceHashRr);
+
static void
peerSourceHashRegisterWithCacheManager(void)
{
class CachePeer;
class PeerSelector;
-void peerSourceHashInit(void);
CachePeer * peerSourceHashSelectParent(PeerSelector*);
#endif /* SQUID_SRC_PEER_SOURCEHASH_H */
#if USE_AUTH
#include "auth/UserRequest.h"
+#include "base/RunnersRegistry.h"
#include "CachePeer.h"
#include "CachePeers.h"
#include "globals.h"
return (*p1)->weight - (*p2)->weight;
}
-void
+static void
peerUserHashInit(void)
{
int W = 0;
0, 1);
}
+/// reacts to RegisteredRunner events relevant to this module
+class PeerUserHashRr: public RegisteredRunner
+{
+public:
+ /* RegisteredRunner API */
+ void useConfig() override { peerUserHashInit(); }
+ void syncConfig() override { peerUserHashInit(); }
+};
+
+DefineRunnerRegistrator(PeerUserHashRr);
+
CachePeer *
peerUserHashSelectParent(PeerSelector *ps)
{
#define SQUID_SRC_PEER_USERHASH_H
class CachePeer;
-class HttpRequest;
class PeerSelector;
-void peerUserHashInit(void);
CachePeer * peerUserHashSelectParent(PeerSelector *);
#endif /* SQUID_SRC_PEER_USERHASH_H */
#include "carp.h"
-class CachePeer;
-class PeerSelector;
-
-void carpInit(void) STUB
CachePeer *carpSelectParent(PeerSelector *) STUB_RETVAL(nullptr)