Add explode on combined timestamp flag
It is useful to not fall back to combined timestamp channels in the
logging infrastructure. Add a flag so we can test it out.
Change-Id: Ifa50ec0cf1802904634b5a89d8324ec7c8bdab44
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/aos/events/logging/log_reader.cc b/aos/events/logging/log_reader.cc
index 4e89a0e..1c3a349 100644
--- a/aos/events/logging/log_reader.cc
+++ b/aos/events/logging/log_reader.cc
@@ -276,6 +276,9 @@
// Otherwise collect this one up as a node to look for a combined
// channel from. It is more efficient to compare nodes than channels.
+ LOG(WARNING) << "Failed to find channel "
+ << finder.SplitChannelName(channel, connection)
+ << " on node " << aos::FlatbufferToJson(node);
remote_nodes.insert(connection->name()->string_view());
}
}
diff --git a/aos/network/timestamp_channel.cc b/aos/network/timestamp_channel.cc
index ab61051..fdaa031 100644
--- a/aos/network/timestamp_channel.cc
+++ b/aos/network/timestamp_channel.cc
@@ -2,6 +2,10 @@
#include "absl/strings/str_cat.h"
+DEFINE_bool(combined_timestamp_channel_fallback, true,
+ "If true, fall back to using the combined timestamp channel if the "
+ "single timestamp channel doesn't exist for a timestamp.");
+
namespace aos {
namespace message_bridge {
@@ -12,7 +16,8 @@
std::string ChannelTimestampFinder::SplitChannelName(
const Channel *channel, const Connection *connection) {
- return SplitChannelName(channel->name()->string_view(), channel->type()->str(), connection);
+ return SplitChannelName(channel->name()->string_view(),
+ channel->type()->str(), connection);
}
std::string ChannelTimestampFinder::SplitChannelName(
@@ -47,6 +52,15 @@
return split_timestamp_channel;
}
+ if (!FLAGS_combined_timestamp_channel_fallback) {
+ LOG(FATAL) << "Failed to find new timestamp channel {\"name\": \""
+ << split_timestamp_channel_name << "\", \"type\": \""
+ << RemoteMessage::GetFullyQualifiedName() << "\"} for "
+ << configuration::CleanedChannelToString(channel)
+ << " connection " << aos::FlatbufferToJson(connection)
+ << " and --nocombined_timestamp_channel_fallback is set";
+ }
+
const std::string shared_timestamp_channel_name =
CombinedChannelName(connection->name()->string_view());
const Channel *shared_timestamp_channel = configuration::GetChannel(