Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
3f92f52
Put Event::TimeSystem& into API and plumb that instead of TimeSystem …
jmarantz Jan 18, 2019
991f7e6
Remove TimeSystem arg from DispatcherImpl.
jmarantz Jan 19, 2019
b9add27
use a Global to manage time-systems to avoid having to plumb them thr…
jmarantz Jan 21, 2019
53b83d9
Remove TimeSystem argument to createApiForTest.
jmarantz Jan 21, 2019
a1234d7
format
jmarantz Jan 21, 2019
f256e6c
Fix more compiler issues.
jmarantz Jan 21, 2019
d1ba8e6
Simplifications.
jmarantz Jan 21, 2019
d5dbd0f
remove extra include.
jmarantz Jan 22, 2019
dbc6f3b
some delegation hacks to reduce the amount of indirection.
jmarantz Jan 23, 2019
3f7396e
format
jmarantz Jan 23, 2019
0deb25b
Merge branch 'master' into plumb-time-source-thru-api
jmarantz Jan 29, 2019
5360c97
Compiles and most tests work.
jmarantz Jan 29, 2019
f4088b6
Merge branch 'master' into plumb-time-source-thru-api
jmarantz Jan 29, 2019
5fad5d6
remove non-essential change.
jmarantz Jan 29, 2019
98fe7cc
More diff reduction.
jmarantz Jan 29, 2019
9e90ba8
remove more superfluous changes.
jmarantz Jan 29, 2019
c31f6ce
Further diff reduction.
jmarantz Jan 29, 2019
6866490
Merge branch 'master' into plumb-time-source-thru-api
jmarantz Jan 30, 2019
9605da6
Merge branch 'master' into plumb-time-source-thru-api
jmarantz Jan 30, 2019
cf51895
Update API instantiation reference
jmarantz Jan 30, 2019
741a021
Merge branch 'master' into plumb-time-source-thru-api
jmarantz Jan 30, 2019
eec742d
Merge branch 'master' into plumb-time-source-thru-api
jmarantz Jan 31, 2019
ca1c0a8
Merge branch 'master' into plumb-time-source-thru-api
jmarantz Jan 31, 2019
53394d6
make API accessors consistently inlined
jmarantz Feb 1, 2019
b08d473
Address reivew comments, and provide a variant of createApiForTest wi…
jmarantz Feb 2, 2019
8e3ccb6
Merge branch 'master' into plumb-time-source-thru-api
jmarantz Feb 4, 2019
f9ea8eb
Merge branch 'master' into plumb-time-source-thru-api
jmarantz Feb 4, 2019
1aae0cc
Remove superfluous test_time_. Make test-name unique.
jmarantz Feb 5, 2019
b4817b2
Merge branch 'master' into plumb-time-source-thru-api
jmarantz Feb 5, 2019
2b5a16e
Add TODO for changing API interface to TimeSource.
jmarantz Feb 5, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions include/envoy/api/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ class Api {

/**
* Allocate a dispatcher.
* @param time_source the time source.
* @return Event::DispatcherPtr which is owned by the caller.
*/
virtual Event::DispatcherPtr allocateDispatcher(Event::TimeSystem& time_system) PURE;
virtual Event::DispatcherPtr allocateDispatcher() PURE;

/**
* @return a reference to the ThreadFactory
Expand All @@ -36,9 +35,15 @@ class Api {
* @return a reference to the Filesystem::Instance
*/
virtual Filesystem::Instance& fileSystem() PURE;

/**
* @return a reference to the TimeSystem
* TODO(jmarantz): change this to return a TimeSource.
*/
virtual Event::TimeSystem& timeSystem() PURE;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per discussion, WDYT about just making this return a TimeSource in this PR? We can still take a TimeSystem in the constructor and not change anything else until a follow up, but this would get us closer to where we want to be?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that would expand this PR significantly because there are a few places in the PR where an existing timeSystem() interface is implemented using API::timeSystem(). If that disappeared I'd have to change a bunch of call-sites. This would be trivial but it would make the PR a lot larger, and there is some semantic content here. So I'd prefer to do that in a separate PR. That OK?

I have this practice of trying to make semantically interesting PRs as small as possible, and letting trivial renaming or type-change PRs go large if needed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure SGTM. I think we are on the same page and heading in the right direction so 👍

};

typedef std::unique_ptr<Api> ApiPtr;

} // namespace Api
} // namespace Envoy
} // namespace Envoy
1 change: 1 addition & 0 deletions include/envoy/server/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ envoy_cc_library(
deps = [
":admin_interface",
"//include/envoy/access_log:access_log_interface",
"//include/envoy/api:api_interface",
"//include/envoy/http:codes_interface",
"//include/envoy/http:context_interface",
"//include/envoy/http:filter_interface",
Expand Down
14 changes: 6 additions & 8 deletions source/common/api/api_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,15 @@ namespace Envoy {
namespace Api {

Impl::Impl(std::chrono::milliseconds file_flush_interval_msec,
Thread::ThreadFactory& thread_factory, Stats::Store& stats_store)
Thread::ThreadFactory& thread_factory, Stats::Store& stats_store,
Event::TimeSystem& time_system)
: thread_factory_(thread_factory),
file_system_(file_flush_interval_msec, thread_factory, stats_store) {}
file_system_(file_flush_interval_msec, thread_factory, stats_store),
time_system_(time_system) {}

Event::DispatcherPtr Impl::allocateDispatcher(Event::TimeSystem& time_system) {
return std::make_unique<Event::DispatcherImpl>(time_system, *this);
Event::DispatcherPtr Impl::allocateDispatcher() {
return std::make_unique<Event::DispatcherImpl>(*this);
}

Thread::ThreadFactory& Impl::threadFactory() { return thread_factory_; }

Filesystem::Instance& Impl::fileSystem() { return file_system_; }

} // namespace Api
} // namespace Envoy
10 changes: 6 additions & 4 deletions source/common/api/api_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,18 @@ namespace Api {
class Impl : public Api {
public:
Impl(std::chrono::milliseconds file_flush_interval_msec, Thread::ThreadFactory& thread_factory,
Stats::Store& stats_store);
Stats::Store& stats_store, Event::TimeSystem& time_system);

// Api::Api
Event::DispatcherPtr allocateDispatcher(Event::TimeSystem& time_system) override;
Thread::ThreadFactory& threadFactory() override;
Filesystem::Instance& fileSystem() override;
Event::DispatcherPtr allocateDispatcher() override;
Thread::ThreadFactory& threadFactory() override { return thread_factory_; }
Filesystem::Instance& fileSystem() override { return file_system_; }
Event::TimeSystem& timeSystem() override { return time_system_; }

private:
Thread::ThreadFactory& thread_factory_;
Filesystem::InstanceImpl file_system_;
Event::TimeSystem& time_system_;
};

} // namespace Api
Expand Down
3 changes: 1 addition & 2 deletions source/common/event/dispatched_thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ namespace Event {
*/
class DispatchedThreadImpl : Logger::Loggable<Envoy::Logger::Id::main> {
public:
DispatchedThreadImpl(Api::Api& api, TimeSystem& time_system)
: api_(api), dispatcher_(new DispatcherImpl(time_system, api_)) {}
explicit DispatchedThreadImpl(Api::Api& api) : api_(api), dispatcher_(new DispatcherImpl(api_)) {}

/**
* Start the thread.
Expand Down
12 changes: 5 additions & 7 deletions source/common/event/dispatcher_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,15 @@
namespace Envoy {
namespace Event {

DispatcherImpl::DispatcherImpl(TimeSystem& time_system, Api::Api& api)
: DispatcherImpl(time_system, Buffer::WatermarkFactoryPtr{new Buffer::WatermarkBufferFactory},
api) {
DispatcherImpl::DispatcherImpl(Api::Api& api)
: DispatcherImpl(Buffer::WatermarkFactoryPtr{new Buffer::WatermarkBufferFactory}, api) {
// The dispatcher won't work as expected if libevent hasn't been configured to use threads.
RELEASE_ASSERT(Libevent::Global::initialized(), "");
}

DispatcherImpl::DispatcherImpl(TimeSystem& time_system, Buffer::WatermarkFactoryPtr&& factory,
Api::Api& api)
: api_(api), time_system_(time_system), buffer_factory_(std::move(factory)),
base_(event_base_new()), scheduler_(time_system_.createScheduler(base_)),
DispatcherImpl::DispatcherImpl(Buffer::WatermarkFactoryPtr&& factory, Api::Api& api)
: api_(api), buffer_factory_(std::move(factory)), base_(event_base_new()),
scheduler_(api.timeSystem().createScheduler(base_)),
deferred_delete_timer_(createTimer([this]() -> void { clearDeferredDeleteList(); })),
post_timer_(createTimer([this]() -> void { runPostCallbacks(); })),
current_to_delete_(&to_delete_1_) {
Expand Down
7 changes: 3 additions & 4 deletions source/common/event/dispatcher_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ namespace Event {
*/
class DispatcherImpl : Logger::Loggable<Logger::Id::main>, public Dispatcher {
public:
explicit DispatcherImpl(TimeSystem& time_system, Api::Api& api);
DispatcherImpl(TimeSystem& time_system, Buffer::WatermarkFactoryPtr&& factory, Api::Api& api);
explicit DispatcherImpl(Api::Api& api);
DispatcherImpl(Buffer::WatermarkFactoryPtr&& factory, Api::Api& api);
~DispatcherImpl();

/**
Expand All @@ -33,7 +33,7 @@ class DispatcherImpl : Logger::Loggable<Logger::Id::main>, public Dispatcher {
event_base& base() { return *base_; }

// Event::Dispatcher
TimeSystem& timeSystem() override { return time_system_; }
TimeSystem& timeSystem() override { return api_.timeSystem(); }
void clearDeferredDeleteList() override;
Network::ConnectionPtr
createServerConnection(Network::ConnectionSocketPtr&& socket,
Expand Down Expand Up @@ -70,7 +70,6 @@ class DispatcherImpl : Logger::Loggable<Logger::Id::main>, public Dispatcher {
bool isThreadSafe() const { return run_tid_ == nullptr || run_tid_->isCurrentThreadId(); }

Api::Api& api_;
TimeSystem& time_system_;
Thread::ThreadIdPtr run_tid_;
Buffer::WatermarkFactoryPtr buffer_factory_;
Libevent::BasePtr base_;
Expand Down
2 changes: 1 addition & 1 deletion source/common/router/router.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class FilterConfig {
context.runtime(), context.random(), std::move(shadow_writer),
PROTOBUF_GET_WRAPPED_OR_DEFAULT(config, dynamic_stats, true),
config.start_child_span(), config.suppress_envoy_headers(),
context.timeSource(), context.httpContext()) {
context.api().timeSystem(), context.httpContext()) {
for (const auto& upstream_log : config.upstream_log()) {
upstream_logs_.push_back(AccessLog::AccessLogFactory::fromProto(upstream_log, context));
}
Expand Down
9 changes: 5 additions & 4 deletions source/server/config_validation/api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ namespace Envoy {
namespace Api {

ValidationImpl::ValidationImpl(std::chrono::milliseconds file_flush_interval_msec,
Thread::ThreadFactory& thread_factory, Stats::Store& stats_store)
: Impl(file_flush_interval_msec, thread_factory, stats_store) {}
Thread::ThreadFactory& thread_factory, Stats::Store& stats_store,
Event::TimeSystem& time_system)
: Impl(file_flush_interval_msec, thread_factory, stats_store, time_system) {}

Event::DispatcherPtr ValidationImpl::allocateDispatcher(Event::TimeSystem& time_system) {
return Event::DispatcherPtr{new Event::ValidationDispatcher(time_system, *this)};
Event::DispatcherPtr ValidationImpl::allocateDispatcher() {
return Event::DispatcherPtr{new Event::ValidationDispatcher(*this)};
}

} // namespace Api
Expand Down
5 changes: 3 additions & 2 deletions source/server/config_validation/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ namespace Api {
class ValidationImpl : public Impl {
public:
ValidationImpl(std::chrono::milliseconds file_flush_interval_msec,
Thread::ThreadFactory& thread_factory, Stats::Store& stats_store);
Thread::ThreadFactory& thread_factory, Stats::Store& stats_store,
Event::TimeSystem& time_system);

Event::DispatcherPtr allocateDispatcher(Event::TimeSystem&) override;
Event::DispatcherPtr allocateDispatcher() override;
};

} // namespace Api
Expand Down
3 changes: 1 addition & 2 deletions source/server/config_validation/async_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
namespace Envoy {
namespace Http {

ValidationAsyncClient::ValidationAsyncClient(Event::TimeSystem& time_system, Api::Api& api)
: dispatcher_(time_system, api) {}
ValidationAsyncClient::ValidationAsyncClient(Api::Api& api) : dispatcher_(api) {}

AsyncClient::Request* ValidationAsyncClient::send(MessagePtr&&, Callbacks&, const RequestOptions&) {
return nullptr;
Expand Down
2 changes: 1 addition & 1 deletion source/server/config_validation/async_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace Http {
*/
class ValidationAsyncClient : public AsyncClient {
public:
ValidationAsyncClient(Event::TimeSystem& time_system, Api::Api& api);
ValidationAsyncClient(Api::Api& api);

// Http::AsyncClient
AsyncClient::Request* send(MessagePtr&& request, Callbacks& callbacks,
Expand Down
2 changes: 1 addition & 1 deletion source/server/config_validation/cluster_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ValidationClusterManager::ValidationClusterManager(
Server::Admin& admin, Api::Api& api, Http::Context& http_context)
: ClusterManagerImpl(bootstrap, factory, stats, tls, runtime, random, local_info, log_manager,
main_thread_dispatcher, admin, api, http_context),
async_client_(main_thread_dispatcher.timeSystem(), api) {}
async_client_(api) {}

Http::ConnectionPool::Instance*
ValidationClusterManager::httpConnPoolForCluster(const std::string&, ResourcePriority,
Expand Down
2 changes: 1 addition & 1 deletion source/server/config_validation/dispatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace Event {
*/
class ValidationDispatcher : public DispatcherImpl {
public:
ValidationDispatcher(TimeSystem& time_system, Api::Api& api) : DispatcherImpl(time_system, api) {}
ValidationDispatcher(Api::Api& api) : DispatcherImpl(api) {}

Network::ClientConnectionPtr
createClientConnection(Network::Address::InstanceConstSharedPtr,
Expand Down
17 changes: 9 additions & 8 deletions source/server/config_validation/server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ ValidationInstance::ValidationInstance(Options& options, Event::TimeSystem& time
Thread::BasicLockable& access_log_lock,
ComponentFactory& component_factory,
Thread::ThreadFactory& thread_factory)
: options_(options), time_system_(time_system), stats_store_(store),
api_(new Api::ValidationImpl(options.fileFlushIntervalMsec(), thread_factory, store)),
dispatcher_(api_->allocateDispatcher(time_system)),
: options_(options), stats_store_(store),
api_(new Api::ValidationImpl(options.fileFlushIntervalMsec(), thread_factory, store,
time_system)),
dispatcher_(api_->allocateDispatcher()),
singleton_manager_(new Singleton::ManagerImpl(api_->threadFactory().currentThreadId())),
access_log_manager_(*api_, *dispatcher_, access_log_lock), mutex_tracer_(nullptr) {
try {
Expand All @@ -69,7 +70,7 @@ void ValidationInstance::initialize(Options& options,
// be ready to serve, then the config has passed validation.
// Handle configuration that needs to take place prior to the main configuration load.
envoy::config::bootstrap::v2::Bootstrap bootstrap;
InstanceUtil::loadBootstrapConfig(bootstrap, options, api());
InstanceUtil::loadBootstrapConfig(bootstrap, options, *api_);

Config::Utility::createTagProducer(bootstrap);

Expand All @@ -81,16 +82,16 @@ void ValidationInstance::initialize(Options& options,

Configuration::InitialImpl initial_config(bootstrap);
overload_manager_ = std::make_unique<OverloadManagerImpl>(dispatcher(), stats(), threadLocal(),
bootstrap.overload_manager(), api());
listener_manager_ = std::make_unique<ListenerManagerImpl>(*this, *this, *this, time_system_);
bootstrap.overload_manager(), *api_);
listener_manager_ = std::make_unique<ListenerManagerImpl>(*this, *this, *this);
thread_local_.registerThread(*dispatcher_, true);
runtime_loader_ = component_factory.createRuntime(*this, initial_config);
secret_manager_ = std::make_unique<Secret::SecretManagerImpl>();
ssl_context_manager_ =
std::make_unique<Extensions::TransportSockets::Tls::ContextManagerImpl>(time_system_);
std::make_unique<Extensions::TransportSockets::Tls::ContextManagerImpl>(api_->timeSystem());
cluster_manager_factory_ = std::make_unique<Upstream::ValidationClusterManagerFactory>(
admin(), runtime(), stats(), threadLocal(), random(), dnsResolver(), sslContextManager(),
dispatcher(), localInfo(), *secret_manager_, api(), http_context_, accessLogManager(),
dispatcher(), localInfo(), *secret_manager_, *api_, http_context_, accessLogManager(),
singletonManager());
config_.initialize(bootstrap, *this, *cluster_manager_factory_);
http_context_.setTracer(config_.httpTracer());
Expand Down
3 changes: 1 addition & 2 deletions source/server/config_validation/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class ValidationInstance : Logger::Loggable<Logger::Id::main>,
Http::Context& httpContext() override { return http_context_; }
ThreadLocal::Instance& threadLocal() override { return thread_local_; }
const LocalInfo::LocalInfo& localInfo() override { return *local_info_; }
Event::TimeSystem& timeSystem() override { return time_system_; }
Event::TimeSystem& timeSystem() override { return api_->timeSystem(); }
Envoy::MutexTracer* mutexTracer() override { return mutex_tracer_; }

std::chrono::milliseconds statsFlushInterval() const override {
Expand Down Expand Up @@ -140,7 +140,6 @@ class ValidationInstance : Logger::Loggable<Logger::Id::main>,
ComponentFactory& component_factory);

Options& options_;
Event::TimeSystem& time_system_;
Stats::IsolatedStoreImpl& stats_store_;
ThreadLocal::InstanceImpl thread_local_;
Api::ApiPtr api_;
Expand Down
4 changes: 2 additions & 2 deletions source/server/guarddog_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ namespace Envoy {
namespace Server {

GuardDogImpl::GuardDogImpl(Stats::Scope& stats_scope, const Server::Configuration::Main& config,
Event::TimeSystem& time_system, Api::Api& api)
: time_system_(time_system), miss_timeout_(config.wdMissTimeout()),
Api::Api& api)
: time_system_(api.timeSystem()), miss_timeout_(config.wdMissTimeout()),
megamiss_timeout_(config.wdMegaMissTimeout()), kill_timeout_(config.wdKillTimeout()),
multi_kill_timeout_(config.wdMultiKillTimeout()),
loop_interval_([&]() -> std::chrono::milliseconds {
Expand Down
3 changes: 1 addition & 2 deletions source/server/guarddog_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ class GuardDogImpl : public GuardDog {
*
* See the configuration documentation for details on the timeout settings.
*/
GuardDogImpl(Stats::Scope& stats_scope, const Server::Configuration::Main& config,
Event::TimeSystem& time_system, Api::Api& api);
GuardDogImpl(Stats::Scope& stats_scope, const Server::Configuration::Main& config, Api::Api& api);
~GuardDogImpl();

/**
Expand Down
5 changes: 2 additions & 3 deletions source/server/listener_manager_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -665,9 +665,8 @@ void ListenerImpl::setSocket(const Network::SocketSharedPtr& socket) {

ListenerManagerImpl::ListenerManagerImpl(Instance& server,
ListenerComponentFactory& listener_factory,
WorkerFactory& worker_factory, TimeSource& time_source)
: server_(server), time_source_(time_source), factory_(listener_factory),
stats_(generateStats(server.stats())),
WorkerFactory& worker_factory)
: server_(server), factory_(listener_factory), stats_(generateStats(server.stats())),
config_tracker_entry_(server.admin().getConfigTracker().add(
"listeners", [this] { return dumpListenerConfigs(); })) {
for (uint32_t i = 0; i < server.options().concurrency(); i++) {
Expand Down
5 changes: 2 additions & 3 deletions source/server/listener_manager_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ struct ListenerManagerStats {
class ListenerManagerImpl : public ListenerManager, Logger::Loggable<Logger::Id::config> {
public:
ListenerManagerImpl(Instance& server, ListenerComponentFactory& listener_factory,
WorkerFactory& worker_factory, TimeSource& time_source);
WorkerFactory& worker_factory);

void onListenerWarmed(ListenerImpl& listener);

Expand All @@ -124,7 +124,6 @@ class ListenerManagerImpl : public ListenerManager, Logger::Loggable<Logger::Id:
Http::Context& httpContext() { return server_.httpContext(); }

Instance& server_;
TimeSource& time_source_;
ListenerComponentFactory& factory_;

private:
Expand Down Expand Up @@ -282,7 +281,7 @@ class ListenerImpl : public Network::ListenerConfig,
const envoy::api::v2::core::Metadata& listenerMetadata() const override {
return config_.metadata();
};
TimeSource& timeSource() override { return parent_.time_source_; }
TimeSource& timeSource() override { return api().timeSystem(); }
void ensureSocketOptions() {
if (!listen_socket_options_) {
listen_socket_options_ =
Expand Down
12 changes: 6 additions & 6 deletions source/server/server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ InstanceImpl::InstanceImpl(Options& options, Event::TimeSystem& time_system,
: shutdown_(false), options_(options), time_system_(time_system), restarter_(restarter),
start_time_(time(nullptr)), original_start_time_(start_time_), stats_store_(store),
thread_local_(tls),
api_(new Api::Impl(options.fileFlushIntervalMsec(), thread_factory, store)),
api_(new Api::Impl(options.fileFlushIntervalMsec(), thread_factory, store, time_system)),
secret_manager_(std::make_unique<Secret::SecretManagerImpl>()),
dispatcher_(api_->allocateDispatcher(time_system)),
dispatcher_(api_->allocateDispatcher()),
singleton_manager_(new Singleton::ManagerImpl(api_->threadFactory().currentThreadId())),
handler_(new ConnectionHandlerImpl(ENVOY_LOGGER(), *dispatcher_)),
random_generator_(std::move(random_generator)), listener_component_factory_(*this),
worker_factory_(thread_local_, *api_, hooks, time_system),
worker_factory_(thread_local_, *api_, hooks),
dns_resolver_(dispatcher_->createDnsResolver({})),
access_log_manager_(*api_, *dispatcher_, access_log_lock), terminated_(false),
mutex_tracer_(options.mutexTracingEnabled() ? &Envoy::MutexTracerImpl::getOrCreateTracer()
Expand Down Expand Up @@ -288,8 +288,8 @@ void InstanceImpl::initialize(Options& options,
bootstrap_.overload_manager(), api());

// Workers get created first so they register for thread local updates.
listener_manager_ = std::make_unique<ListenerManagerImpl>(*this, listener_component_factory_,
worker_factory_, time_system_);
listener_manager_ =
std::make_unique<ListenerManagerImpl>(*this, listener_component_factory_, worker_factory_);

// The main thread is also registered for thread local updates so that code that does not care
// whether it runs on the main thread or on workers can still use TLS.
Expand Down Expand Up @@ -348,7 +348,7 @@ void InstanceImpl::initialize(Options& options,

// GuardDog (deadlock detection) object and thread setup before workers are
// started and before our own run() loop runs.
guard_dog_ = std::make_unique<Server::GuardDogImpl>(stats_store_, config_, time_system_, api());
guard_dog_ = std::make_unique<Server::GuardDogImpl>(stats_store_, config_, api());
}

void InstanceImpl::startWorkers() {
Expand Down
2 changes: 1 addition & 1 deletion source/server/worker_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Envoy {
namespace Server {

WorkerPtr ProdWorkerFactory::createWorker(OverloadManager& overload_manager) {
Event::DispatcherPtr dispatcher(api_.allocateDispatcher(time_system_));
Event::DispatcherPtr dispatcher(api_.allocateDispatcher());
return WorkerPtr{new WorkerImpl(
tls_, hooks_, std::move(dispatcher),
Network::ConnectionHandlerPtr{new ConnectionHandlerImpl(ENVOY_LOGGER(), *dispatcher)},
Expand Down
Loading