Commit 13f04ecf authored by Sam McNally's avatar Sam McNally Committed by Commit Bot

Clear mount_start_ when deferring DriveFS startup due to being offline.

For the first DriveFS, mount, mount_start_ is retained across mount
attempts to record the total time taken to launch. When the DriveFS
mount fails while offline, retries are delayed until online again. If a
retry for the first launch is delayed in this fashion, the original
start time is retained, causing spurious long first mount time metrics
to be reported. Avoid this by clearing mount_start_ when delaying
retries due to being offline. Clear it when disabling drive too.

Bug: 892524
Change-Id: I47db55ca5b17965267ef813e2e70b7f7d90b662a
Reviewed-on: https://chromium-review.googlesource.com/c/1322345Reviewed-by: default avatarSergei Datsenko <dats@chromium.org>
Commit-Queue: Sam McNally <sammc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606024}
parent 8a6c3f9c
...@@ -451,6 +451,7 @@ class DriveIntegrationService::PreferenceWatcher ...@@ -451,6 +451,7 @@ class DriveIntegrationService::PreferenceWatcher
if (integration_service_->drivefs_holder_ && if (integration_service_->drivefs_holder_ &&
integration_service_->remount_when_online_ && !is_offline) { integration_service_->remount_when_online_ && !is_offline) {
integration_service_->remount_when_online_ = false; integration_service_->remount_when_online_ = false;
integration_service_->mount_start_ = {};
integration_service_->AddDriveMountPoint(); integration_service_->AddDriveMountPoint();
return; return;
} }
...@@ -761,6 +762,7 @@ void DriveIntegrationService::SetEnabled(bool enabled) { ...@@ -761,6 +762,7 @@ void DriveIntegrationService::SetEnabled(bool enabled) {
drivefs_total_failures_count_ = 0; drivefs_total_failures_count_ = 0;
drivefs_consecutive_failures_count_ = 0; drivefs_consecutive_failures_count_ = 0;
mount_failed_ = false; mount_failed_ = false;
mount_start_ = {};
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment