Commit 43fd4036 authored by rajendrant's avatar rajendrant Committed by Commit Bot

Reduce bypass duration on 407 auth failures

With network-servicification, 407 failures bypass the proxy for a random duration of
1-5 minutes, which leads to drop in data saver usage. This CL reduces that bypass
duration. This CL also reduces initial delay for fetching the client config.

Bug: 945419
Change-Id: Ifc297a3ee7b681e76ce752612a6b05feba642ce8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1539210Reviewed-by: default avatarTarun Bansal <tbansal@chromium.org>
Commit-Queue: rajendrant <rajendrant@chromium.org>
Cr-Commit-Position: refs/heads/master@{#644642}
parent 0036a65f
...@@ -696,6 +696,23 @@ IN_PROC_BROWSER_TEST_F(DataReductionProxyFallbackBrowsertest, ...@@ -696,6 +696,23 @@ IN_PROC_BROWSER_TEST_F(DataReductionProxyFallbackBrowsertest,
EXPECT_THAT(GetBody(), kDummyBody); EXPECT_THAT(GetBody(), kDummyBody);
} }
IN_PROC_BROWSER_TEST_F(DataReductionProxyFallbackBrowsertest,
ProxyBlockedOnAuthError) {
base::HistogramTester histogram_tester;
net::EmbeddedTestServer test_server;
test_server.RegisterRequestHandler(
base::BindRepeating(&BasicResponse, kDummyBody));
ASSERT_TRUE(test_server.Start());
SetStatusCode(net::HTTP_PROXY_AUTHENTICATION_REQUIRED);
ui_test_utils::NavigateToURL(browser(),
GetURLWithMockHost(test_server, "/echo"));
EXPECT_THAT(GetBody(), kDummyBody);
histogram_tester.ExpectUniqueSample("DataReductionProxy.BlockTypePrimary",
BYPASS_EVENT_TYPE_MALFORMED_407, 1);
}
class DataReductionProxyResourceTypeBrowsertest class DataReductionProxyResourceTypeBrowsertest
: public DataReductionProxyBrowsertest { : public DataReductionProxyBrowsertest {
public: public:
......
...@@ -83,8 +83,8 @@ const uint32_t kMaxBackgroundFetchIntervalSeconds = 6 * 60 * 60; // 6 hours. ...@@ -83,8 +83,8 @@ const uint32_t kMaxBackgroundFetchIntervalSeconds = 6 * 60 * 60; // 6 hours.
// Reduction Proxy configuration service. // Reduction Proxy configuration service.
const net::BackoffEntry::Policy kDefaultBackoffPolicy = { const net::BackoffEntry::Policy kDefaultBackoffPolicy = {
0, // num_errors_to_ignore 0, // num_errors_to_ignore
30 * 1000, // initial_delay_ms 10 * 1000, // initial_delay_ms
4, // multiply_factor 3, // multiply_factor
0.25, // jitter_factor, 0.25, // jitter_factor,
128 * 60 * 1000, // maximum_backoff_ms 128 * 60 * 1000, // maximum_backoff_ms
-1, // entry_lifetime_ms -1, // entry_lifetime_ms
......
...@@ -422,6 +422,11 @@ DataReductionProxyBypassType GetDataReductionProxyBypassType( ...@@ -422,6 +422,11 @@ DataReductionProxyBypassType GetDataReductionProxyBypassType(
// interpreted by data reduction proxy. // interpreted by data reduction proxy.
if (headers.response_code() == net::HTTP_PROXY_AUTHENTICATION_REQUIRED && if (headers.response_code() == net::HTTP_PROXY_AUTHENTICATION_REQUIRED &&
!headers.HasHeader("Proxy-Authenticate")) { !headers.HasHeader("Proxy-Authenticate")) {
// Bypass all proxies for a few RTTs until the config fetch could update the
// session key. The value 500 ms is the RTT observed for config fetches.
data_reduction_proxy_info->bypass_all = true;
data_reduction_proxy_info->bypass_duration =
base::TimeDelta::FromMilliseconds(3 * 500);
return BYPASS_EVENT_TYPE_MALFORMED_407; return BYPASS_EVENT_TYPE_MALFORMED_407;
} }
......
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