Add support for changing the max out of order time
This lets us be more accepting for tricky logs.
Change-Id: Ife3cc95cbf56489ccbbe5e5b377b04d608407d78
diff --git a/aos/network/multinode_timestamp_filter.cc b/aos/network/multinode_timestamp_filter.cc
index 08dab79..a042d35 100644
--- a/aos/network/multinode_timestamp_filter.cc
+++ b/aos/network/multinode_timestamp_filter.cc
@@ -17,6 +17,9 @@
"of CSV files in /tmp/. This should only be needed when debugging "
"time synchronization.");
+DEFINE_int32(max_invalid_distance_ns, 500,
+ "The max amount of time we will let the solver go backwards.");
+
namespace aos {
namespace message_bridge {
namespace {
@@ -1057,7 +1060,7 @@
case TimeComparison::kInvalid: {
// If times are close enough, drop the invalid time.
if (InvalidDistance(result_times, solution) <
- chrono::nanoseconds(500)) {
+ chrono::nanoseconds(FLAGS_max_invalid_distance_ns)) {
VLOG(1) << "Times can't be compared by "
<< InvalidDistance(result_times, solution).count() << "ns";
for (size_t i = 0; i < result_times.size(); ++i) {
@@ -1119,7 +1122,8 @@
LOG(ERROR) << "Skipping because --skip_order_validation";
break;
} else {
- LOG(FATAL) << "Please investigate.";
+ LOG(FATAL) << "Please investigate. Use --max_invalid_distance_ns "
+ "to change this.";
}
} break;
}