GH-443: fix uses of timestamp 0 in cluster diagnostic logs

For broker.log and cluster.log: there was a race condition.  A worker's
first IOSource that it processes is potentially Broker if there were
no packets available yet and thread scheduling happens to work out
such that network connections (inside CAF threads) become established
before we enter the main I/O loop.  Such peering establishments would
generate logs with timestamp 0 as there was not yet any code path
taken that would update network_time.

For reporter.log: any non-worker (packet-processing) node would just
unnecessarily use a timestamp of 0 for their reporter messages.
This commit is contained in:
Jon Siwek 2019-06-27 23:00:42 -07:00
parent 7b56925b77
commit 430f9a92c6
4 changed files with 15 additions and 9 deletions

View file

@ -941,6 +941,12 @@ void Manager::Process()
if ( had_input )
{
if ( network_time == 0 )
// If we're getting Broker messages, but still haven't initialized
// network_time, may as well do so now because otherwise the
// broker/cluster logs will end up using timestamp 0.
net_update_time(current_time());
++times_processed_without_idle;
// The max number of Process calls allowed to happen in a row without