diff options
author | zea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-15 00:54:57 +0000 |
---|---|---|
committer | zea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-15 00:54:57 +0000 |
commit | 56ad07a31f80bb472f9f584943804e0539bda720 (patch) | |
tree | baf9557565fa92c0bcd2fdb58214084841f2ba1d /google_apis | |
parent | 2816e1f32ac606e9d41f687f3fa2f71c247104f3 (diff) | |
download | chromium_src-56ad07a31f80bb472f9f584943804e0539bda720.zip chromium_src-56ad07a31f80bb472f9f584943804e0539bda720.tar.gz chromium_src-56ad07a31f80bb472f9f584943804e0539bda720.tar.bz2 |
[GCM] Update backoff policy to be more conservative.
Just tweaking the backoff constants to better reflect what to do in case of
server error. Future patches will introduce alternative policies for different
kinds of errors.
BUG=284553
Review URL: https://codereview.chromium.org/164183008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251462 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'google_apis')
-rw-r--r-- | google_apis/gcm/gcm_client_impl.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/google_apis/gcm/gcm_client_impl.cc b/google_apis/gcm/gcm_client_impl.cc index 14a9468..3100e71 100644 --- a/google_apis/gcm/gcm_client_impl.cc +++ b/google_apis/gcm/gcm_client_impl.cc @@ -27,8 +27,10 @@ namespace gcm { namespace { -// Backoff policy. Shared across reconnection logic and checkin/registration +// Backoff policy. Shared across reconnection logic and checkin/(un)registration // 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. // 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. + 30 * 1000, // 30 seconds. // 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. + 10 * 60 * 1000, // 10 minutes. // Time to keep an entry from being discarded even when it // has no significant state, -1 to never discard. |