Commit f81db0d3 authored by Dominik Charousset's avatar Dominik Charousset

Fix initialization order of actor_system

parent 50d010ca
...@@ -605,6 +605,9 @@ private: ...@@ -605,6 +605,9 @@ private:
/// Used to generate ascending actor IDs. /// Used to generate ascending actor IDs.
std::atomic<size_t> ids_; std::atomic<size_t> ids_;
/// Manages all metrics collected by the system.
telemetry::metric_registry metrics_;
/// Identifies this actor system in a distributed setting. /// Identifies this actor system in a distributed setting.
node_id node_; node_id node_;
...@@ -644,9 +647,6 @@ private: ...@@ -644,9 +647,6 @@ private:
/// The system-wide, user-provided configuration. /// The system-wide, user-provided configuration.
actor_system_config& cfg_; actor_system_config& cfg_;
/// Manages all metrics collected by the system.
telemetry::metric_registry metrics_;
/// Stores whether the logger has run its destructor and stopped any thread, /// Stores whether the logger has run its destructor and stopped any thread,
/// file handle, etc. /// file handle, etc.
std::atomic<bool> logger_dtor_done_; std::atomic<bool> logger_dtor_done_;
......
...@@ -219,6 +219,7 @@ actor_system::networking_module::~networking_module() { ...@@ -219,6 +219,7 @@ actor_system::networking_module::~networking_module() {
actor_system::actor_system(actor_system_config& cfg) actor_system::actor_system(actor_system_config& cfg)
: profiler_(cfg.profiler), : profiler_(cfg.profiler),
ids_(0), ids_(0),
metrics_(cfg),
logger_(new caf::logger(*this), false), logger_(new caf::logger(*this), false),
registry_(*this), registry_(*this),
groups_(*this), groups_(*this),
...@@ -226,7 +227,6 @@ actor_system::actor_system(actor_system_config& cfg) ...@@ -226,7 +227,6 @@ actor_system::actor_system(actor_system_config& cfg)
await_actors_before_shutdown_(true), await_actors_before_shutdown_(true),
detached_(0), detached_(0),
cfg_(cfg), cfg_(cfg),
metrics_(cfg),
logger_dtor_done_(false), logger_dtor_done_(false),
tracing_context_(cfg.tracing_context) { tracing_context_(cfg.tracing_context) {
CAF_SET_LOGGER_SYS(this); CAF_SET_LOGGER_SYS(this);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment