diff options
author | Yao Chen <yaochen@google.com> | 2018-04-10 10:39:53 -0700 |
---|---|---|
committer | Yangster <yanglu@google.com> | 2018-04-10 22:06:03 -0700 |
commit | 163d2602dbc79133096b3dec7920ee157ff1a88b (patch) | |
tree | ea8f68e27b820748af245db7c90e36ff92a99bf8 /tools/aapt2/java/JavaClassGenerator_test.cpp | |
parent | 5f91d5ee942ed2af54349a2a78f635237a84dbb4 (diff) |
Handle logd reconnect.
When statsd reconnects to logd, statsd will read all logs from buffer again. To prevent us from
reprocessing old events, we do the following:
1. At any given moment, record the largest timestamp(T_max) and last timestamp (check point) that
we've seen before.
2. When reconnection happens, we look for the check point until we see a new log with a timestamp
larger than T_max.
-> If we found the CP, resume after the CP. Success
-> If we can't find CP, there is definitely log loss. We reset all configs.
Note:
1. Logd has an API to read logs after a certain timestamp. But this api is vulnerable to
time changes from Settings. So we cannot rely on it.
2. If logd inserts a new log (with older timestamp) before CP, we cannot detect it. It's not
possible to detect it without record all timestamps we have seen.
Test: statsd_test
Bug: 77813113
Change-Id: Ic3fdb47230807606ab11dc994cb162194adb8448
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator_test.cpp')
0 files changed, 0 insertions, 0 deletions