------------------------------------------------------------ revno: 13294 revision-id: rousskov@measurement-factory.com-20140221161405-g7rphc3l68s99mgf parent: rousskov@measurement-factory.com-20140221154501-db25sx27zqu19xgd committer: Alex Rousskov branch nick: trunk timestamp: Fri 2014-02-21 09:14:05 -0700 message: Migrated RegisteredRunners to a multi-action interface. Old generic two-action RegisteredRunners were good for handling paired create/destroy events, but not all main.cc events fit that model well. In fact, even the old runners implemented the destruction action for one event only (rrAfterConfig); all other runners implemented a single action. The adjusted API better supports runners that are interested in any number of the supported events. It also allows a single runner object to handle multiple events, which simplifies current code and may help with better [re]configuration handling in the future. Added startShutdown() and finishShutdown() events. The former will be needed for authentication module shutdown and more polished shutdown initiation code in general (patch pending). The latter is needed for final cleanup code that previously ran as the destruction action for rrAfterConfig. finishShutdown() also destroys all runners. Note that the master process in SMP mode does not run startShutdown because that process lacks the main loop and startShutdown() promises at least one main loop iteration (to help with clean connections closures, for example). Added syncConfig() event that will be needed for the standby pool implementation (patch pending) and future code that reacts to Squid configuration changes caused by reconfiguration. "after config" event is now called "use config" to better match verb+noun or action+object naming scheme. ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: rousskov@measurement-factory.com-20140221161405-\ # g7rphc3l68s99mgf # target_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # testament_sha1: ff2a4be897342b2b4399eaa64592ba3bf4d3b0d8 # timestamp: 2014-02-21 16:53:46 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # base_revision_id: rousskov@measurement-factory.com-20140221154501-\ # db25sx27zqu19xgd # # Begin patch === modified file 'src/CollapsedForwarding.cc' --- src/CollapsedForwarding.cc 2014-01-27 05:27:41 +0000 +++ src/CollapsedForwarding.cc 2014-02-21 16:14:05 +0000 @@ -134,16 +134,16 @@ virtual ~CollapsedForwardingRr(); protected: - virtual void create(const RunnerRegistry &); - virtual void open(const RunnerRegistry &); + virtual void create(); + virtual void open(); private: Ipc::MultiQueue::Owner *owner; }; -RunnerRegistrationEntry(rrAfterConfig, CollapsedForwardingRr); +RunnerRegistrationEntry(CollapsedForwardingRr); -void CollapsedForwardingRr::create(const RunnerRegistry &) +void CollapsedForwardingRr::create() { Must(!owner); owner = Ipc::MultiQueue::Init(ShmLabel, Config.workers, 1, @@ -151,7 +151,7 @@ QueueCapacity); } -void CollapsedForwardingRr::open(const RunnerRegistry &) +void CollapsedForwardingRr::open() { CollapsedForwarding::Init(); } === modified file 'src/DiskIO/IpcIo/IpcIoFile.cc' --- src/DiskIO/IpcIo/IpcIoFile.cc 2014-02-21 15:45:01 +0000 +++ src/DiskIO/IpcIo/IpcIoFile.cc 2014-02-21 16:14:05 +0000 @@ -907,17 +907,27 @@ } /// reports our needs for shared memory pages to Ipc::Mem::Pages -class IpcIoClaimMemoryNeedsRr: public RegisteredRunner +/// and initializes shared memory segments used by IpcIoFile +class IpcIoRr: public Ipc::Mem::RegisteredRunner { public: /* RegisteredRunner API */ - virtual void run(const RunnerRegistry &r); + IpcIoRr(): owner(NULL) {} + virtual ~IpcIoRr(); + virtual void claimMemoryNeeds(); + +protected: + /* Ipc::Mem::RegisteredRunner API */ + virtual void create(); + +private: + Ipc::FewToFewBiQueue::Owner *owner; }; -RunnerRegistrationEntry(rrClaimMemoryNeeds, IpcIoClaimMemoryNeedsRr); +RunnerRegistrationEntry(IpcIoRr); void -IpcIoClaimMemoryNeedsRr::run(const RunnerRegistry &) +IpcIoRr::claimMemoryNeeds() { const int itemsCount = Ipc::FewToFewBiQueue::MaxItemsCount( ::Config.workers, ::Config.cacheSwap.n_strands, QueueCapacity); @@ -929,24 +939,8 @@ static_cast(itemsCount * 1.1)); } -/// initializes shared memory segments used by IpcIoFile -class IpcIoRr: public Ipc::Mem::RegisteredRunner -{ -public: - /* RegisteredRunner API */ - IpcIoRr(): owner(NULL) {} - virtual ~IpcIoRr(); - -protected: - virtual void create(const RunnerRegistry &); - -private: - Ipc::FewToFewBiQueue::Owner *owner; -}; - -RunnerRegistrationEntry(rrAfterConfig, IpcIoRr); - -void IpcIoRr::create(const RunnerRegistry &) +void +IpcIoRr::create() { if (Config.cacheSwap.n_strands <= 0) return; === modified file 'src/MemStore.cc' --- src/MemStore.cc 2014-01-01 19:20:49 +0000 +++ src/MemStore.cc 2014-02-21 16:14:05 +0000 @@ -746,33 +746,38 @@ return entryLimit; } -/// reports our needs for shared memory pages to Ipc::Mem::Pages -class MemStoreClaimMemoryNeedsRr: public RegisteredRunner +/// reports our needs for shared memory pages to Ipc::Mem::Pages; +/// decides whether to use a shared memory cache or checks its configuration; +/// and initializes shared memory segments used by MemStore +class MemStoreRr: public Ipc::Mem::RegisteredRunner { public: /* RegisteredRunner API */ - virtual void run(const RunnerRegistry &r); + MemStoreRr(): spaceOwner(NULL), mapOwner(NULL) {} + virtual void finalizeConfig(); + virtual void claimMemoryNeeds(); + virtual void useConfig(); + virtual ~MemStoreRr(); + +protected: + /* Ipc::Mem::RegisteredRunner API */ + virtual void create(); + +private: + Ipc::Mem::Owner *spaceOwner; ///< free slices Owner + MemStoreMap::Owner *mapOwner; ///< primary map Owner }; -RunnerRegistrationEntry(rrClaimMemoryNeeds, MemStoreClaimMemoryNeedsRr); +RunnerRegistrationEntry(MemStoreRr); void -MemStoreClaimMemoryNeedsRr::run(const RunnerRegistry &) +MemStoreRr::claimMemoryNeeds() { Ipc::Mem::NotePageNeed(Ipc::Mem::PageId::cachePage, MemStore::EntryLimit()); } -/// decides whether to use a shared memory cache or checks its configuration -class MemStoreCfgRr: public ::RegisteredRunner -{ -public: - /* RegisteredRunner API */ - virtual void run(const RunnerRegistry &); -}; - -RunnerRegistrationEntry(rrFinalizeConfig, MemStoreCfgRr); - -void MemStoreCfgRr::run(const RunnerRegistry &r) +void +MemStoreRr::finalizeConfig() { // decide whether to use a shared memory cache if the user did not specify if (!Config.memShared.configured()) { @@ -790,32 +795,15 @@ } } -/// initializes shared memory segments used by MemStore -class MemStoreRr: public Ipc::Mem::RegisteredRunner -{ -public: - /* RegisteredRunner API */ - MemStoreRr(): spaceOwner(NULL), mapOwner(NULL) {} - virtual void run(const RunnerRegistry &); - virtual ~MemStoreRr(); - -protected: - virtual void create(const RunnerRegistry &); - -private: - Ipc::Mem::Owner *spaceOwner; ///< free slices Owner - MemStoreMap::Owner *mapOwner; ///< primary map Owner -}; - -RunnerRegistrationEntry(rrAfterConfig, MemStoreRr); - -void MemStoreRr::run(const RunnerRegistry &r) +void +MemStoreRr::useConfig() { assert(Config.memShared.configured()); - Ipc::Mem::RegisteredRunner::run(r); + Ipc::Mem::RegisteredRunner::useConfig(); } -void MemStoreRr::create(const RunnerRegistry &) +void +MemStoreRr::create() { if (!Config.memShared) return; === modified file 'src/Transients.cc' --- src/Transients.cc 2014-02-21 10:46:19 +0000 +++ src/Transients.cc 2014-02-21 16:14:05 +0000 @@ -384,27 +384,27 @@ public: /* RegisteredRunner API */ TransientsRr(): mapOwner(NULL) {} - virtual void run(const RunnerRegistry &); + virtual void useConfig(); virtual ~TransientsRr(); protected: - virtual void create(const RunnerRegistry &); + virtual void create(); private: TransientsMap::Owner *mapOwner; }; -RunnerRegistrationEntry(rrAfterConfig, TransientsRr); +RunnerRegistrationEntry(TransientsRr); void -TransientsRr::run(const RunnerRegistry &r) +TransientsRr::useConfig() { assert(Config.memShared.configured()); - Ipc::Mem::RegisteredRunner::run(r); + Ipc::Mem::RegisteredRunner::useConfig(); } void -TransientsRr::create(const RunnerRegistry &) +TransientsRr::create() { if (!Config.onoff.collapsed_forwarding) return; === modified file 'src/base/RunnersRegistry.cc' --- src/base/RunnersRegistry.cc 2012-01-20 18:55:04 +0000 +++ src/base/RunnersRegistry.cc 2014-02-21 16:14:05 +0000 @@ -1,52 +1,40 @@ #include "squid.h" #include "base/RunnersRegistry.h" -#include -#include - -typedef std::list Runners; -typedef std::map Registries; - -/// all known registries -static Registries *TheRegistries = NULL; - -/// returns the requested runners list, initializing structures as needed +#include + +/// a collection of unique runners, in no particular order +typedef std::set Runners; +/// all known runners +static Runners *TheRunners = NULL; + +/// safely returns registered runners, initializing structures as needed static Runners & -GetRunners(const RunnerRegistry ®istryId) +GetRunners() { - if (!TheRegistries) - TheRegistries = new Registries; - - if (TheRegistries->find(registryId) == TheRegistries->end()) - (*TheRegistries)[registryId] = new Runners; - - return *(*TheRegistries)[registryId]; + if (!TheRunners) + TheRunners = new Runners; + return *TheRunners; } int -RegisterRunner(const RunnerRegistry ®istryId, RegisteredRunner *rr) +RegisterRunner(RegisteredRunner *rr) { - Runners &runners = GetRunners(registryId); - runners.push_back(rr); + Runners &runners = GetRunners(); + runners.insert(rr); return runners.size(); } -int -ActivateRegistered(const RunnerRegistry ®istryId) +void +RunRegistered(const RegisteredRunner::Method &m) { - Runners &runners = GetRunners(registryId); + Runners &runners = GetRunners(); typedef Runners::iterator RRI; for (RRI i = runners.begin(); i != runners.end(); ++i) - (*i)->run(registryId); - return runners.size(); -} + ((*i)->*m)(); -void -DeactivateRegistered(const RunnerRegistry ®istryId) -{ - Runners &runners = GetRunners(registryId); - while (!runners.empty()) { - delete runners.back(); - runners.pop_back(); + if (m == &RegisteredRunner::finishShutdown) { + delete TheRunners; + TheRunners = NULL; } } === modified file 'src/base/RunnersRegistry.h' --- src/base/RunnersRegistry.h 2012-08-28 13:00:30 +0000 +++ src/base/RunnersRegistry.h 2014-02-21 16:14:05 +0000 @@ -2,70 +2,94 @@ #define SQUID_BASE_RUNNERSREGISTRY_H /** - * This API allows virtually any module to register with a well-known registry, - * be activated by some central processor at some registry-specific time, and - * be deactiveated by some central processor at some registry-specific time. + * This API allows virtually any module to register its interest in receiving + * notification about initial configuration availability, configuration changes + * and other critical events in Squid lifetime without exposing the notifier + * to the details of the module. * * For example, main.cc may activate registered I/O modules after parsing - * squid.conf and deactivate them before exiting. + * squid.conf and deactivate them before exiting, all without knowing what + * those I/O modules really are. * * A module in this context is code providing a functionality or service to the - * rest of Squid, such as src/DiskIO/Blocking, src/fs/ufs, or Cache Manager. A - * module must declare a RegisteredRunner child class to implement activation and - * deactivation logic using the run() method and destructor, respectively. + * rest of Squid, such as src/DiskIO/Blocking, src/fs/ufs, or Cache Manager. To + * receive notifications, a module must declare a RegisteredRunner child class + * and implement the methods corresponding to the events the module is + * interested in. * - * This API allows the registry to determine the right [de]activation time for - * each group of similar modules, without knowing any module specifics. + * The order of events is documented in this header (where applicable), but + * the order in which runners are notified about a given event is undefined. + * If a specific notification order is required, split the event into two or + * more related event(s), documenting their relative order here. * */ -/// well-known registries -typedef enum { - /// Managed by main.cc. Activated after parsing squid.conf and - /// deactivated before freeing configuration-related memory or exit()-ing. - /// Meant for setting configuration options that depend on other - /// configuration options and were not explicitly configured. - rrFinalizeConfig, - - /// Managed by main.cc. Activated after rrFinalizeConfig and - /// deactivated before rrFinalizeConfig. Meant for announcing - /// memory reservations before memory is allocated. - rrClaimMemoryNeeds, - - /// Managed by main.cc. Activated after rrClaimMemoryNeeds and - /// deactivated before rrClaimMemoryNeeds. Meant for activating - /// modules and features based on the finalized configuration. - rrAfterConfig, - - rrEnd ///< not a real registry, just a label to mark the end of enum -} RunnerRegistry; - /// a runnable registrant API +/// kids must override [only] the methods they are interested in class RegisteredRunner { public: - // called when this runner's registry is deactivated + /* Related methods below are declared in their calling order */ + + /* Configuration events */ + + /// Called after parsing squid.conf. + /// Meant for setting configuration options that depend on other + /// configuration options and were not explicitly configured. + virtual void finalizeConfig() {} + + /// Called after finalizeConfig(). + /// Meant for announcing memory reservations before memory is allocated. + virtual void claimMemoryNeeds() {} + + /// Called after claimMemoryNeeds(). + /// Meant for activating modules and features using a finalized + /// configuration with known memory requirements. + virtual void useConfig() {} + + /* Reconfiguration events */ + + /// Called after parsing squid.conf during reconfiguration. + /// Meant for adjusting the module state based on configuration changes. + virtual void syncConfig() {} + + /* Shutdown events */ + + /// Called after receiving a shutdown request and before stopping the main + /// loop. At least one main loop iteration is guaranteed after this call. + /// Meant for cleanup and state saving that may require other modules. + virtual void startShutdown() {} + + /// Called after stopping the main loop. + /// Meant for quick/basic cleanup that does not require any other modules. virtual ~RegisteredRunner() {} - - // called when this runner's registry is activated - virtual void run(const RunnerRegistry &r) = 0; + /// exists to simplify caller interface; override the destructor instead + void finishShutdown() { delete this; } + + /// a pointer to one of the above notification methods + typedef void (RegisteredRunner::*Method)(); + }; /// registers a given runner with the given registry and returns registry count -int RegisterRunner(const RunnerRegistry ®istry, RegisteredRunner *rr); - -/// calls run() methods of all runners in the given registry -int ActivateRegistered(const RunnerRegistry ®istry); -/// deletes all runners in the given registry -void DeactivateRegistered(const RunnerRegistry ®istry); +int RegisterRunner(RegisteredRunner *rr); + +/// Calls a given method of all runners. +/// All runners are destroyed after the finishShutdown() call. +void RunRegistered(const RegisteredRunner::Method &m); + +/// convenience macro to describe/debug the caller and the method being called +#define RunRegisteredHere(m) \ + debugs(1, 2, "running " # m); \ + RunRegistered(&m) /// convenience function to "use" an otherwise unreferenced static variable bool UseThisStatic(const void *); /// convenience macro: register one RegisteredRunner kid as early as possible -#define RunnerRegistrationEntry(Registry, Who) \ - static const bool Who ## _RegisteredWith_ ## Registry = \ - RegisterRunner(Registry, new Who) > 0 && \ - UseThisStatic(& Who ## _RegisteredWith_ ## Registry); +#define RunnerRegistrationEntry(Who) \ + static const bool Who ## _Registered_ = \ + RegisterRunner(new Who) > 0 && \ + UseThisStatic(& Who ## _Registered_); #endif /* SQUID_BASE_RUNNERSREGISTRY_H */ === modified file 'src/cache_cf.cc' --- src/cache_cf.cc 2014-02-21 10:46:19 +0000 +++ src/cache_cf.cc 2014-02-21 16:14:05 +0000 @@ -4602,14 +4602,15 @@ public: static Ssl::BumpMode lastDeprecatedRule; /* RegisteredRunner API */ - virtual void run(const RunnerRegistry &); + virtual void finalizeConfig(); }; Ssl::BumpMode sslBumpCfgRr::lastDeprecatedRule = Ssl::bumpEnd; -RunnerRegistrationEntry(rrFinalizeConfig, sslBumpCfgRr); +RunnerRegistrationEntry(sslBumpCfgRr); -void sslBumpCfgRr::run(const RunnerRegistry &r) +void +sslBumpCfgRr::finalizeConfig() { if (lastDeprecatedRule != Ssl::bumpEnd) { assert( lastDeprecatedRule == Ssl::bumpClientFirst || lastDeprecatedRule == Ssl::bumpNone); === modified file 'src/client_db.cc' --- src/client_db.cc 2014-02-08 13:36:42 +0000 +++ src/client_db.cc 2014-02-21 16:14:05 +0000 @@ -124,12 +124,13 @@ class ClientDbRr: public RegisteredRunner { public: - virtual void run(const RunnerRegistry &); + /* RegisteredRunner API */ + virtual void useConfig(); }; -RunnerRegistrationEntry(rrAfterConfig, ClientDbRr); +RunnerRegistrationEntry(ClientDbRr); void -ClientDbRr::run(const RunnerRegistry &r) +ClientDbRr::useConfig() { clientdbInit(); Mgr::RegisterAction("client_list", "Cache Client List", clientdbDump, 0, 1); === modified file 'src/fs/rock/RockSwapDir.cc' --- src/fs/rock/RockSwapDir.cc 2013-12-31 18:49:41 +0000 +++ src/fs/rock/RockSwapDir.cc 2014-02-21 16:14:05 +0000 @@ -1004,10 +1004,10 @@ namespace Rock { -RunnerRegistrationEntry(rrAfterConfig, SwapDirRr); +RunnerRegistrationEntry(SwapDirRr); } -void Rock::SwapDirRr::create(const RunnerRegistry &) +void Rock::SwapDirRr::create() { Must(mapOwners.empty() && freeSlotsOwners.empty()); for (int i = 0; i < Config.cacheSwap.n_configured; ++i) { === modified file 'src/fs/rock/RockSwapDir.h' --- src/fs/rock/RockSwapDir.h 2014-02-10 16:39:10 +0000 +++ src/fs/rock/RockSwapDir.h 2014-02-21 16:14:05 +0000 @@ -143,7 +143,7 @@ protected: /* Ipc::Mem::RegisteredRunner API */ - virtual void create(const RunnerRegistry &); + virtual void create(); private: std::vector mapOwners; === modified file 'src/ipc/mem/Pages.cc' --- src/ipc/mem/Pages.cc 2013-10-25 00:13:46 +0000 +++ src/ipc/mem/Pages.cc 2014-02-21 16:14:05 +0000 @@ -90,28 +90,28 @@ public: /* RegisteredRunner API */ SharedMemPagesRr(): owner(NULL) {} - virtual void run(const RunnerRegistry &); - virtual void create(const RunnerRegistry &); - virtual void open(const RunnerRegistry &); + virtual void useConfig(); + virtual void create(); + virtual void open(); virtual ~SharedMemPagesRr(); private: Ipc::Mem::PagePool::Owner *owner; }; -RunnerRegistrationEntry(rrAfterConfig, SharedMemPagesRr); +RunnerRegistrationEntry(SharedMemPagesRr); void -SharedMemPagesRr::run(const RunnerRegistry &r) +SharedMemPagesRr::useConfig() { if (Ipc::Mem::PageLimit() <= 0) return; - Ipc::Mem::RegisteredRunner::run(r); + Ipc::Mem::RegisteredRunner::useConfig(); } void -SharedMemPagesRr::create(const RunnerRegistry &) +SharedMemPagesRr::create() { Must(!owner); owner = Ipc::Mem::PagePool::Init(PagePoolId, Ipc::Mem::PageLimit(), @@ -119,7 +119,7 @@ } void -SharedMemPagesRr::open(const RunnerRegistry &) +SharedMemPagesRr::open() { Must(!ThePagePool); ThePagePool = new Ipc::Mem::PagePool(PagePoolId); === modified file 'src/ipc/mem/Segment.cc' --- src/ipc/mem/Segment.cc 2012-09-01 14:38:36 +0000 +++ src/ipc/mem/Segment.cc 2014-02-21 16:14:05 +0000 @@ -279,7 +279,7 @@ #endif // HAVE_SHM void -Ipc::Mem::RegisteredRunner::run(const RunnerRegistry &r) +Ipc::Mem::RegisteredRunner::useConfig() { // If Squid is built with real segments, we create() real segments // in the master process only. Otherwise, we create() fake @@ -290,10 +290,10 @@ #else if (IamWorkerProcess()) #endif - create(r); + create(); // we assume that master process does not need shared segments // unless it is also a worker if (!InDaemonMode() || !IamMasterProcess()) - open(r); + open(); } === modified file 'src/ipc/mem/Segment.h' --- src/ipc/mem/Segment.h 2012-09-01 14:38:36 +0000 +++ src/ipc/mem/Segment.h 2014-02-21 16:14:05 +0000 @@ -72,14 +72,14 @@ { public: /* RegisteredRunner API */ - virtual void run(const RunnerRegistry &r); + virtual void useConfig(); protected: /// called when the runner should create a new memory segment - virtual void create(const RunnerRegistry &) = 0; + virtual void create() = 0; /// called when the runner should open a previously created segment, /// not needed if segments are opened in constructor or init methods - virtual void open(const RunnerRegistry &) {} + virtual void open() {} }; } // namespace Mem === modified file 'src/main.cc' --- src/main.cc 2014-01-24 01:57:15 +0000 +++ src/main.cc 2014-02-21 16:14:05 +0000 @@ -274,6 +274,8 @@ /* detach the auth components (only do this on full shutdown) */ Auth::Scheme::FreeAll(); #endif + + RunRegisteredHere(RegisteredRunner::startShutdown); eventAdd("SquidShutdown", &StopEventLoop, this, (double) (wait + 1), 1, false); } @@ -804,6 +806,8 @@ Config.workers = oldWorkers; } + RunRegisteredHere(RegisteredRunner::syncConfig); + if (IamPrimaryProcess()) CpuAffinityCheck(); CpuAffinityReconfigure(); @@ -1443,9 +1447,9 @@ debugs(1,2, HERE << "Doing post-config initialization\n"); leave_suid(); - ActivateRegistered(rrFinalizeConfig); - ActivateRegistered(rrClaimMemoryNeeds); - ActivateRegistered(rrAfterConfig); + RunRegisteredHere(RegisteredRunner::finalizeConfig); + RunRegisteredHere(RegisteredRunner::claimMemoryNeeds); + RunRegisteredHere(RegisteredRunner::useConfig); enter_suid(); if (!opt_no_daemon && Config.workers > 0) @@ -1804,9 +1808,9 @@ if (!TheKids.someRunning() && !TheKids.shouldRestartSome()) { leave_suid(); - DeactivateRegistered(rrAfterConfig); - DeactivateRegistered(rrClaimMemoryNeeds); - DeactivateRegistered(rrFinalizeConfig); + // XXX: Master process has no main loop and, hence, should not call + // RegisteredRunner::startShutdown which promises a loop iteration. + RunRegisteredHere(RegisteredRunner::finishShutdown); enter_suid(); if (TheKids.someSignaled(SIGINT) || TheKids.someSignaled(SIGTERM)) { @@ -1902,9 +1906,6 @@ Store::Root().sync(); /* Flush log close */ StoreFileSystem::FreeAllFs(); DiskIOModule::FreeAllModules(); - DeactivateRegistered(rrAfterConfig); - DeactivateRegistered(rrClaimMemoryNeeds); - DeactivateRegistered(rrFinalizeConfig); #if LEAK_CHECK_MODE && 0 /* doesn't work at the moment */ configFreeMemory(); @@ -1939,6 +1940,8 @@ memClean(); + RunRegisteredHere(RegisteredRunner::finishShutdown); + #if XMALLOC_TRACE xmalloc_find_leaks(); === modified file 'src/ssl/support.cc' --- src/ssl/support.cc 2014-02-08 13:36:42 +0000 +++ src/ssl/support.cc 2014-02-21 16:14:05 +0000 @@ -1839,26 +1839,26 @@ public: /* RegisteredRunner API */ SharedSessionCacheRr(): owner(NULL) {} - virtual void run(const RunnerRegistry &); + virtual void useConfig(); virtual ~SharedSessionCacheRr(); protected: - virtual void create(const RunnerRegistry &); + virtual void create(); private: Ipc::MemMap::Owner *owner; }; -RunnerRegistrationEntry(rrAfterConfig, SharedSessionCacheRr); +RunnerRegistrationEntry(SharedSessionCacheRr); void -SharedSessionCacheRr::run(const RunnerRegistry &r) +SharedSessionCacheRr::useConfig() { - Ipc::Mem::RegisteredRunner::run(r); + Ipc::Mem::RegisteredRunner::useConfig(); } void -SharedSessionCacheRr::create(const RunnerRegistry &) +SharedSessionCacheRr::create() { if (!isSslServer()) //no need to configure ssl session cache. return; === modified file 'src/tests/testRock.cc' --- src/tests/testRock.cc 2014-02-21 10:46:19 +0000 +++ src/tests/testRock.cc 2014-02-21 16:14:05 +0000 @@ -80,7 +80,7 @@ store->create(); rr = new Rock::SwapDirRr; - rr->run(rrAfterConfig); + rr->useConfig(); } void @@ -94,7 +94,8 @@ free_cachedir(&Config.cacheSwap); - delete rr; + rr->finishShutdown(); // deletes rr + rr = NULL; // TODO: do this once, or each time. // safe_free(Config.replPolicy->type);