From 3269310e61a2a5d60be247edca19678fdf7ec4df Mon Sep 17 00:00:00 2001 From: Arne Welzel Date: Wed, 15 Mar 2023 15:12:06 +0100 Subject: [PATCH] broker::Manager: No more network_time forwarding network_time forwarding will happen in the main-loop before draining the EventMgr so timers/events scheduled based on broker messages should behave similarly. This also keeps network_time unaffected during non pseudo-realtime trace processing. --- src/broker/Manager.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/broker/Manager.cc b/src/broker/Manager.cc index e35ece26e2..37042d78d1 100644 --- a/src/broker/Manager.cc +++ b/src/broker/Manager.cc @@ -1140,11 +1140,6 @@ void Manager::DispatchMessage(const broker::topic& topic, broker::data msg) void Manager::Process() { - // Ensure that time gets update before processing broker messages, or events - // based on them might get scheduled wrong. - if ( use_real_time ) - run_state::detail::update_network_time(util::current_time()); - auto messages = bstate->subscriber.poll(); bool had_input = ! messages.empty(); @@ -1221,10 +1216,16 @@ void Manager::Process() if ( had_input ) { if ( run_state::network_time == 0 ) + { // If we're getting Broker messages, but still haven't initialized // run_state::network_time, may as well do so now because otherwise the // broker/cluster logs will end up using timestamp 0. - run_state::detail::update_network_time(util::current_time()); + // + // Do not do this when allow_network_time_forard is set to F + // with the assumption that this is unwanted behavior. + if ( get_option("allow_network_time_forward")->AsBool() ) + run_state::detail::update_network_time(util::current_time()); + } } }