Retry remote timestamps from message_bridge_client
Mithun and I debugged a log file bug to be that the timestamp didn't get
delivered. James confirmed that under heavy CPU and network load, this
can happen and it never gets retried, even though we are sending it with
a ttl of 0.
When the Send call fails, we should instead put the message in a FIFO
and try it again later. That will let us recover in this case somewhat
sanely.
This turns out to be fiendishly hard to test in a robust way. I
hand-coded fault injection but don't have a good way to check it in yet.
Coming in a future patch set...
Change-Id: Ia577818386fceafd4fffebafe4fe2a95dde13884
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/network/message_bridge_test.cc b/aos/network/message_bridge_test.cc
index 4eb5e8b..cc46926 100644
--- a/aos/network/message_bridge_test.cc
+++ b/aos/network/message_bridge_test.cc
@@ -733,7 +733,9 @@
{
MakePi2Server();
- RunPi2Server(chrono::milliseconds(3050));
+ // Wait long enough for the client to connect again. It currently takes 3
+ // seconds of connection to estimate the time offset.
+ RunPi2Server(chrono::milliseconds(4050));
// And confirm we are synchronized again.
EXPECT_TRUE(pi1_server_statistics_fetcher.Fetch());