summaryrefslogtreecommitdiff
path: root/services/incremental/IncrementalService.cpp
diff options
context:
space:
mode:
authorAlex Buynytskyy <alexbuy@google.com>2021-03-25 12:33:15 -0700
committerAlex Buynytskyy <alexbuy@google.com>2021-03-25 13:23:33 -0700
commit5ac5553879faf44e9c219cccb33489a19f0451e6 (patch)
treec9c77bc4f8799defaf9439ee4afeea8a9e2fbd47 /services/incremental/IncrementalService.cpp
parentf5386796a869c483f6a75eb00ff2db65c1e69397 (diff)
More logging and better retry logic.
Bug: 183551663 Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest Change-Id: I1b6da82cd4472cc5671b0b60fb12222b4ed08e17
Diffstat (limited to 'services/incremental/IncrementalService.cpp')
-rw-r--r--services/incremental/IncrementalService.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/services/incremental/IncrementalService.cpp b/services/incremental/IncrementalService.cpp
index 94f8e59c6057..6695ba841b67 100644
--- a/services/incremental/IncrementalService.cpp
+++ b/services/incremental/IncrementalService.cpp
@@ -2523,7 +2523,8 @@ std::optional<Milliseconds> IncrementalService::DataLoaderStub::needToBind() {
now - mCurrentStatusTs <= Constants::bindingTimeout) {
LOG(INFO) << "Binding still in progress. "
<< (healthy ? "The DL is healthy/freshly bound, ok to retry for a few times."
- : "Already unhealthy, don't do anything.");
+ : "Already unhealthy, don't do anything.")
+ << " for storage " << mId;
// Binding still in progress.
if (!healthy) {
// Already unhealthy, don't do anything.
@@ -2546,7 +2547,8 @@ std::optional<Milliseconds> IncrementalService::DataLoaderStub::needToBind() {
const auto previousBindTs = mPreviousBindTs;
mPreviousBindTs = now;
- const auto nonCrashingInterval = std::max(castToMs(now - previousBindTs), 100ms);
+ const auto nonCrashingInterval =
+ std::max(castToMs(now - previousBindTs - mPreviousBindDelay), 100ms);
if (previousBindTs.time_since_epoch() == Clock::duration::zero() ||
nonCrashingInterval > Constants::healthyDataLoaderUptime) {
mPreviousBindDelay = 0ms;
@@ -2575,7 +2577,8 @@ bool IncrementalService::DataLoaderStub::bind() {
const auto bindDelay = *maybeBindDelay;
if (bindDelay > 1s) {
LOG(INFO) << "Delaying bind to " << mParams.packageName << " by "
- << bindDelay.count() / 1000 << "s";
+ << bindDelay.count() / 1000 << "s"
+ << " for storage " << mId;
}
bool result = false;