Commit e371e74c authored by Dominik Charousset's avatar Dominik Charousset

Avoid repeated calls to stream finalizers

parent 5c8b2b3b
......@@ -116,15 +116,21 @@ void stream_manager::handle(stream_slots slots, upstream_msg::ack_batch& x) {
}
void stream_manager::handle(stream_slots slots, upstream_msg::drop&) {
CAF_LOG_TRACE(CAF_ARG(slots));
out().close(slots.receiver);
}
void stream_manager::handle(stream_slots slots, upstream_msg::forced_drop& x) {
CAF_LOG_TRACE(CAF_ARG(slots) << CAF_ARG(x));
if (out().remove_path(slots.receiver, x.reason, true))
stop(std::move(x.reason));
}
void stream_manager::stop(error reason) {
CAF_LOG_TRACE(CAF_ARG(reason));
if (stopped())
return;
flags_ = is_stopped_flag;
if (reason)
out().abort(reason);
else
......@@ -135,8 +141,7 @@ void stream_manager::stop(error reason) {
void stream_manager::shutdown() {
CAF_LOG_TRACE("");
// Mark as shutting down and reset other flags.
if (shutting_down())
if (getf(is_shutting_down_flag | is_stopped_flag))
return;
flags_ = is_shutting_down_flag;
CAF_LOG_DEBUG("emit shutdown messages on" << inbound_paths_.size()
......
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