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

Unified Diff: google_apis/gcm/gcm_client_impl.cc

Issue 164183008: [GCM] Update backoff policy to be more conservative. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gcm/gcm_client_impl.cc
diff --git a/google_apis/gcm/gcm_client_impl.cc b/google_apis/gcm/gcm_client_impl.cc
index 14a94687a923d5672cf583caf1aefd8a94183a86..a2d570b74eedc07f80202d40229f5f7ef251ea2f 100644
--- a/google_apis/gcm/gcm_client_impl.cc
+++ b/google_apis/gcm/gcm_client_impl.cc
@@ -29,6 +29,8 @@ namespace {
// Backoff policy. Shared across reconnection logic and checkin/registration
fgorski 2014/02/14 18:36:29 also unregistration
Nicolas Zea 2014/02/14 18:39:47 Done.
// retries.
+// Note: In order to ensure a minimum of 20 seconds between server errors (for
+// server reasons), we have a 30s += 10s (33%) jitter initial backoff.
fgorski 2014/02/14 18:36:29 +/- insted of +=?
Nicolas Zea 2014/02/14 18:39:47 Done.
// TODO(zea): consider sharing/synchronizing the scheduling of backoff retries
// themselves.
const net::BackoffEntry::Policy kDefaultBackoffPolicy = {
@@ -37,17 +39,17 @@ const net::BackoffEntry::Policy kDefaultBackoffPolicy = {
0,
// Initial delay for exponential back-off in ms.
- 15000, // 15 seconds.
+ 1000 * 30, // 30 seconds.
fgorski 2014/02/14 18:36:29 nit: would big-endian be more intuitive? 30* 1000
Nicolas Zea 2014/02/14 18:39:47 Done.
// Factor by which the waiting time will be multiplied.
2,
// Fuzzing percentage. ex: 10% will spread requests randomly
// between 90%-100% of the calculated time.
- 0.5, // 50%.
+ 0.33, // 33%.
// Maximum amount of time we are willing to delay our request in ms.
- 1000 * 60 * 5, // 5 minutes.
+ 1000 * 60 * 10, // 10 minutes.
fgorski 2014/02/14 18:36:29 nit: same here, big endian?
Nicolas Zea 2014/02/14 18:39:47 Done.
// Time to keep an entry from being discarded even when it
// has no significant state, -1 to never discard.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698