Skip to content

Commit

Permalink
move oldRouting into pool context from group
Browse files Browse the repository at this point in the history
  • Loading branch information
CamJN committed Jan 31, 2025
1 parent c07ce26 commit eaf3953
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 13 deletions.
7 changes: 5 additions & 2 deletions src/agent/Core/ApplicationPool/Context.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,19 @@ struct Context {
boost::object_pool<Process> processObjectPool;
mutable boost::mutex agentConfigSyncher;

// Whether to use the old routing algorithm
bool oldRouting;

/****** Dependencies ******/

SpawningKit::FactoryPtr spawningKitFactory;
Json::Value agentConfig;


Context()
Context(bool _oldRouting)
: sessionObjectPool(64, 1024),
processObjectPool(4, 64)
processObjectPool(4, 64),
oldRouting(_oldRouting)
{ }

void finalize() {
Expand Down
3 changes: 0 additions & 3 deletions src/agent/Core/ApplicationPool/Group.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,6 @@ class Group: public boost::enable_shared_from_this<Group> {
Callback shutdownCallback;
GroupPtr selfPointer;

// Whether to use the old routing algorithm
bool oldRouting;

/****** Initialization and shutdown ******/

static ApiKey generateApiKey(const Pool *pool);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ Group::Group(Pool *_pool, const Options &_options)
}

detachedProcessesCheckerActive = false;
oldRouting = _options.oldRouting;
}

Group::~Group() {
Expand Down
2 changes: 1 addition & 1 deletion src/agent/Core/ApplicationPool/Group/SessionManagement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ Group::get(const Options &newOptions, const GetCallback &callback,

bool
Group::useNewRouting() const {
return !oldRouting;
return !pool->context->oldRouting;
}

} // namespace ApplicationPool2
Expand Down
5 changes: 1 addition & 4 deletions src/agent/Core/ApplicationPool/Options.h
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,6 @@ class Options {

/*********************************/

bool oldRouting;

/**
* Creates a new Options object with the default values filled in.
* One must still set appRoot manually, after having used this constructor.
Expand Down Expand Up @@ -481,8 +479,7 @@ class Options {
statThrottleRate(DEFAULT_STAT_THROTTLE_RATE),
maxRequests(0),
currentTime(0),
noop(false),
oldRouting(false)
noop(false)
/*********************************/
{
/*********************************/
Expand Down
1 change: 0 additions & 1 deletion src/agent/Core/Controller/InitRequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ Controller::fillPoolOptionsFromConfigCaches(Options &options,
options.statThrottleRate = mainConfig.statThrottleRate;
options.maxRequests = requestConfig->defaultMaxRequests;
options.stickySessionsCookieAttributes = requestConfig->defaultStickySessionsCookieAttributes;
options.oldRouting = mainConfig.oldRouting;
/******************************/
}

Expand Down
2 changes: 1 addition & 1 deletion src/agent/Core/CoreMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ initializeNonPrivilegedWorkingObjects() {
wo->spawningKitContext->finalize();

UPDATE_TRACE_POINT();
wo->appPoolContext = boost::make_shared<ApplicationPool2::Context>();
wo->appPoolContext = boost::make_shared<ApplicationPool2::Context>(coreConfig->get("old_routing").asBool());
wo->appPoolContext->spawningKitFactory = boost::make_shared<SpawningKit::Factory>(
wo->spawningKitContext.get());
wo->appPoolContext->agentConfig = coreConfig->inspectEffectiveValues();
Expand Down

0 comments on commit eaf3953

Please sign in to comment.