Commit 17a7d1fc authored by Yann Dago's avatar Yann Dago Committed by Chromium LUCI CQ

Fix wrong function called when sync times out waiting for policies

This fixes the fact that the wrong data was sent to the histogram
"Sync.Startup.PolicyLoadTimeout" and uses a new histogram named
"Sync.Startup.PolicyLoadTimeout2" to avoid using the wrong data.

Bug: 1129065
Change-Id: Iaa42e0ede6348f130a8e1e09ea35c2989aaff955
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2629574
Commit-Queue: Yann Dago <ydago@chromium.org>
Reviewed-by: default avatarCaitlin Fischer <caitlinfischer@google.com>
Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Auto-Submit: Yann Dago <ydago@chromium.org>
Cr-Commit-Position: refs/heads/master@{#844668}
parent c07f11c3
......@@ -126,9 +126,8 @@ void StartupController::TryStart(bool force_immediate) {
waiting_for_policies_start_time_ = base::Time::Now();
wait_for_policy_timer_.Start(
FROM_HERE, switches::kSyncPolicyLoadTimeout.Get(),
base::BindOnce(&StartupController::OnFirstPoliciesLoaded,
base::Unretained(this),
policy::PolicyDomain::POLICY_DOMAIN_CHROME));
base::BindOnce(&StartupController::OnFirstPoliciesLoadedTimeout,
base::Unretained(this)));
}
// If the Service had to start immediately, bypass the deferred startup when
// we receive the policies.
......@@ -211,7 +210,7 @@ void StartupController::OnFirstPoliciesLoadedImpl(bool timeout) {
policy_service_->RemoveObserver(policy::PolicyDomain::POLICY_DOMAIN_CHROME,
this);
policy_service_ = nullptr;
base::UmaHistogramBoolean("Sync.Startup.PolicyLoadTimeout", timeout);
base::UmaHistogramBoolean("Sync.Startup.PolicyLoadTimeout2", timeout);
base::UmaHistogramTimes(
"Sync.Startup.PolicyLoadStartupDelay",
waiting_for_policies_start_time_.is_null()
......
......@@ -939,6 +939,23 @@ can be compared for the same population). -->
</histogram>
<histogram name="Sync.Startup.PolicyLoadTimeout" enum="Boolean"
expires_after="2021-02-01">
<obsolete>
Deprecated in 02/2021 for having wrong data. Use
Sync.Startup.PolicyLoadTimeout2.
</obsolete>
<owner>ydago@chromium.org</owner>
<owner>treib@chromium.org</owner>
<summary>
Use Sync.Startup.PolicyLoadTimeout2 to Records the sync engine timed out
while waiting for policy load before starting. In case of a timeout, the
sync engine attempts to start ignoring potential policy restrictions. This
histogram contains wrong data, please use Sync.Startup.PolicyLoadTimeout2
instead.
</summary>
</histogram>
<histogram name="Sync.Startup.PolicyLoadTimeout2" enum="Boolean"
expires_after="2021-11-01">
<owner>ydago@chromium.org</owner>
<owner>treib@chromium.org</owner>
......
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