Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Unified Diff: components/quirks/quirks_client.cc

Issue 2016883003: Remove Quirks flag, limit server retries (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/quirks/BUILD.gn ('k') | components/quirks/quirks_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/quirks/quirks_client.cc
diff --git a/components/quirks/quirks_client.cc b/components/quirks/quirks_client.cc
index 383c91126a6c7bfd254c38dbb54187ce3fe06901..17ca7416e25e825b3f16750711341fd99b8e09b9 100644
--- a/components/quirks/quirks_client.cc
+++ b/components/quirks/quirks_client.cc
@@ -25,6 +25,8 @@ const char kQuirksUrlFormat[] =
"https://chromeosquirksserver-pa.googleapis.com/v2/display/%s/clients"
"/chromeos/M%d";
+const int kMaxServerFailures = 10;
+
const net::BackoffEntry::Policy kDefaultBackoffPolicy = {
1, // Initial errors before applying backoff
10000, // 10 seconds.
@@ -111,6 +113,12 @@ void QuirksClient::OnURLFetchComplete(const net::URLFetcher* source) {
}
if (server_error) {
+ if (backoff_entry_.failure_count() >= kMaxServerFailures) {
+ // After 10 retires (5+ hours), give up, and try again in a month.
+ VLOG(1) << "Too many retries; Quirks Client shutting down.";
+ Shutdown(false);
+ return;
+ }
url_fetcher_.reset();
Retry();
return;
« no previous file with comments | « components/quirks/BUILD.gn ('k') | components/quirks/quirks_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698