Commit 67441bc7 authored by Dominik Charousset's avatar Dominik Charousset

Improve trace logging of actor pool

parent 0a7c90f8
...@@ -148,6 +148,7 @@ actor_pool::actor_pool(actor_config& cfg) ...@@ -148,6 +148,7 @@ actor_pool::actor_pool(actor_config& cfg)
bool actor_pool::filter(upgrade_lock<detail::shared_spinlock>& guard, bool actor_pool::filter(upgrade_lock<detail::shared_spinlock>& guard,
const strong_actor_ptr& sender, message_id mid, const strong_actor_ptr& sender, message_id mid,
const message& msg, execution_unit* eu) { const message& msg, execution_unit* eu) {
CAF_LOG_TRACE(CAF_ARG(mid) << CAF_ARG(msg));
auto rsn = planned_reason_; auto rsn = planned_reason_;
if (rsn != caf::exit_reason::not_exited) { if (rsn != caf::exit_reason::not_exited) {
guard.unlock(); guard.unlock();
...@@ -165,9 +166,8 @@ bool actor_pool::filter(upgrade_lock<detail::shared_spinlock>& guard, ...@@ -165,9 +166,8 @@ bool actor_pool::filter(upgrade_lock<detail::shared_spinlock>& guard,
workers_.swap(workers); workers_.swap(workers);
planned_reason_ = msg.get_as<exit_msg>(0).reason; planned_reason_ = msg.get_as<exit_msg>(0).reason;
unique_guard.unlock(); unique_guard.unlock();
for (auto& w : workers) { for (auto& w : workers)
anon_send(w, msg); anon_send(w, msg);
}
quit(eu); quit(eu);
return true; return true;
} }
...@@ -177,9 +177,9 @@ bool actor_pool::filter(upgrade_lock<detail::shared_spinlock>& guard, ...@@ -177,9 +177,9 @@ bool actor_pool::filter(upgrade_lock<detail::shared_spinlock>& guard,
upgrade_to_unique_lock<detail::shared_spinlock> unique_guard{guard}; upgrade_to_unique_lock<detail::shared_spinlock> unique_guard{guard};
auto last = workers_.end(); auto last = workers_.end();
auto i = std::find(workers_.begin(), workers_.end(), dm.source); auto i = std::find(workers_.begin(), workers_.end(), dm.source);
if (i != last) { CAF_LOG_DEBUG_IF(i == last, "received down message for an unknown worker");
if (i != last)
workers_.erase(i); workers_.erase(i);
}
if (workers_.empty()) { if (workers_.empty()) {
planned_reason_ = exit_reason::out_of_workers; planned_reason_ = exit_reason::out_of_workers;
unique_guard.unlock(); unique_guard.unlock();
......
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