Broker: Remove network time initialization

Remove the special case of initializing network time if it hasn't
happened yet. The argument about broker.log containing 0.0 timestamps
is more a problem of the log, not something that would justify modifying
network time globally. For broker.log and possibly cluster.log, it might
be more reasonable to use current time, anyway.

I was a bit wary about tables backed by broker stores being populated
with network_time set to 0.0, but there seems to exist logic and assumptions
that this is okay: It should be the same as if one populates a table with
expirations set within zeek_init().

In fact, staring a bit more, *not setting* network time might be more correct
as workers that don't see packets would never set zeek_start_network_time
which is used within the expiration computation.
This commit is contained in:
Arne Welzel 2023-03-24 13:20:44 +01:00
parent 96bbb96b35
commit 59b1e29e81
3 changed files with 10 additions and 22 deletions

View file

@ -1218,21 +1218,6 @@ void Manager::Process()
ProcessStoreResponse(s.second, move(r));
}
}
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.
//
// 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());
}
}
}
void Manager::ProcessStoreEventInsertUpdate(const TableValPtr& table, const std::string& store_id,