Commit 56ad07a3 authored by zea@chromium.org's avatar zea@chromium.org

[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
parent 2816e1f3
......@@ -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.
......
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