Chromium Code Reviews| Index: net/base/backoff_entry.cc |
| diff --git a/net/base/backoff_entry.cc b/net/base/backoff_entry.cc |
| index 44bae52731b2cd998295a8c37d0b22631975aa59..e023ce4976265524db7784f2228e08d02b0d8ff5 100644 |
| --- a/net/base/backoff_entry.cc |
| +++ b/net/base/backoff_entry.cc |
| @@ -29,10 +29,13 @@ 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. |
| + failure_count_ = std::max(0, --failure_count_); |
|
sanjeevr
2011/05/04 20:23:09
I think we need to think of a better fix in the lo
Jói
2011/05/04 20:30:14
Added a TODO to revisit this.
|
| // 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 |