| Index: net/base/backoff_entry.cc
|
| diff --git a/net/base/backoff_entry.cc b/net/base/backoff_entry.cc
|
| index 44bae52731b2cd998295a8c37d0b22631975aa59..29d0dbc81cccd814de0227a3e055cb27fd09b7ea 100644
|
| --- a/net/base/backoff_entry.cc
|
| +++ b/net/base/backoff_entry.cc
|
| @@ -29,10 +29,17 @@ BackoffEntry::~BackoffEntry() {
|
|
|
| void BackoffEntry::InformOfRequest(bool succeeded) {
|
| if (!succeeded) {
|
| - failure_count_++;
|
| + ++failure_count_;
|
| exponential_backoff_release_time_ = CalculateReleaseTime();
|
| } else {
|
| - failure_count_ = 0;
|
| + // We slowly decay the number of times delayed instead of resetting it to 0
|
| + // in order to stay stable if we receive successes interleaved between lots
|
| + // of failures.
|
| + //
|
| + // TODO(joi): Revisit this; it might be most correct to go to zero
|
| + // but have a way to go back to "old error count +1" if there is
|
| + // another error soon after.
|
| + failure_count_ = std::max(0, --failure_count_);
|
|
|
| // The reason why we are not just cutting the release time to GetTimeNow()
|
| // is on the one hand, it would unset a release time set by
|
|
|