New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 902489 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 21
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , iOS , Chrome , Mac
Pri: 3
Type: Bug



Sign in to add a comment

Variations "fetch shortly" logic is shadowed by http fallback

Project Member Reported by asvitk...@chromium.org, Nov 6

Issue description

Variations "fetch shortly" logic is shadowed by http fallback.

Here's the relevant code:

    // If the current fetch attempt was over an HTTPS connection, retry the
    // fetch immediately over an HTTP connection.
    // Currently we only do this if if the 'VariationsHttpRetry' feature is
    // enabled.
    if (was_https && !insecure_variations_server_url_.is_empty()) {
      // When re-trying via HTTP, return immediately. OnURLFetchComplete() will
      // be called with the result of that retry.
      if (DoFetchFromURL(insecure_variations_server_url_, true))
        return;
    }
    // It's common for the very first fetch attempt to fail (e.g. the network
    // may not yet be available). In such a case, try again soon, rather than
    // waiting the full time interval.
    // |request_scheduler_| will be null during unit tests.
    if (is_first_request && request_scheduler_)
      request_scheduler_->ScheduleFetchShortly();


Given the comment on the second if, the consequence is that we'll often retry via HTTP in cases where it's actually common for the first HTTPS request to fail. This is wrong, we should only fall back to HTTP after the "fetch shortly" request fails.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Nov 21

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9a162a62fb34ea1350740f901b1079f5ddeafea2

commit 9a162a62fb34ea1350740f901b1079f5ddeafea2
Author: Alexei Svitkine <asvitkine@chromium.org>
Date: Wed Nov 21 16:22:14 2018

Fix a couple issues with HTTP fallback with variations.

- Makes the "retry shortly" logic on first failed request
  takes precedence over HTTP fallback. This way, when this
  happens users won't immediately try HTTP if the first
  request fails (which can be frequent per comment).

- Makes it so if there's a restrict parameter, the HTTP
  fallback is disabled. This should prevent users with
  a restrict parameter toggling their state (since that
  can have surprising and undesirable effects such as
  UI features toggling on and off.)

Bug:  902489 
Change-Id: I2cd7d24258acb7363287086a63fb94a93de8cd89
Reviewed-on: https://chromium-review.googlesource.com/c/1340823
Commit-Queue: Alexei Svitkine <asvitkine@chromium.org>
Reviewed-by: Julian Pastarmov <pastarmovj@chromium.org>
Reviewed-by: Carlos IL <carlosil@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610097}
[modify] https://crrev.com/9a162a62fb34ea1350740f901b1079f5ddeafea2/chrome/browser/chromeos/policy/variations_service_policy_browsertest.cc
[modify] https://crrev.com/9a162a62fb34ea1350740f901b1079f5ddeafea2/chrome/browser/policy/policy_browsertest.cc
[modify] https://crrev.com/9a162a62fb34ea1350740f901b1079f5ddeafea2/components/variations/service/variations_service.cc
[modify] https://crrev.com/9a162a62fb34ea1350740f901b1079f5ddeafea2/components/variations/service/variations_service.h
[modify] https://crrev.com/9a162a62fb34ea1350740f901b1079f5ddeafea2/components/variations/service/variations_service_unittest.cc

Labels: M-72 OS-Android OS-Chrome OS-iOS OS-Linux OS-Mac OS-Windows
Status: Fixed (was: Assigned)

Sign in to add a comment