Make starterd less likely to crash when under stress
When I added information to the starter daemon to allow it to more
easily print out the versions of applications that had crashed, this
inadvertently created a scenario where the starterd would crash if the
system was under heavy load and the starter fell behind on watching
timing reports. We really shouldn't do this in starterd, so alter it so
that if the code that looks for timing reports observes that we have
fallen behind significantly, it skips over all the old data rather than
trying to read every single old message.
Change-Id: Ia3318d347a528f1f1539ce9fcad741c3268f4f44
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/starter/starterd_lib.h b/aos/starter/starterd_lib.h
index 81a4deb..92b20fa 100644
--- a/aos/starter/starterd_lib.h
+++ b/aos/starter/starterd_lib.h
@@ -61,7 +61,7 @@
// Called periodically to run through the timing report fetcher and alert all
// the Application's to the new messages.
- void ServiceTimingReportFetcher();
+ void ServiceTimingReportFetcher(int elapsed_cycles);
void SendStatus();
@@ -75,7 +75,7 @@
aos::ShmEventLoop event_loop_;
aos::Sender<aos::starter::Status> status_sender_;
- aos::TimerHandler *status_timer_;
+ aos::PhasedLoopHandler *status_timer_;
aos::TimerHandler *cleanup_timer_;
int status_count_ = 0;