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

Issue 337803004: Backoff: Respect maximum delay in face of float overflow (Closed)

Created:
6 years, 6 months ago by Nicolas Zea
Modified:
6 years, 6 months ago
Reviewers:
cbentzel, Ryan Sleevi
CC:
chromium-reviews, cbentzel+watch_chromium.org
Project:
chromium
Visibility:
Public.

Description

Backoff: Respect maximum delay in face of float overflow Due to the 11 bit limitations for exponents in double precision, it's possible to overflow when calculating the backoff amount. Check for this overflow and drop back to the max backoff delay if necessary. BUG=373181 R=cbentzel@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=278153

Patch Set 1 #

Total comments: 6

Patch Set 2 : Use CheckedNumeric and don't rely on policy max #

Total comments: 9

Patch Set 3 : Check max release time too #

Unified diffs Side-by-side diffs Delta from patch set Stats (+48 lines, -11 lines) Patch
M net/base/backoff_entry.cc View 1 2 2 chunks +30 lines, -11 lines 0 comments Download
M net/base/backoff_entry_unittest.cc View 1 1 chunk +18 lines, -0 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
Nicolas Zea
+Chris, please take a look
6 years, 6 months ago (2014-06-14 03:35:23 UTC) #1
cbentzel
Adding rsleevi because he's better about thinking through overflow concerns than I am. https://codereview.chromium.org/337803004/diff/1/net/base/backoff_entry.cc File ...
6 years, 6 months ago (2014-06-14 15:16:07 UTC) #2
cbentzel
https://codereview.chromium.org/337803004/diff/1/net/base/backoff_entry.cc File net/base/backoff_entry.cc (right): https://codereview.chromium.org/337803004/diff/1/net/base/backoff_entry.cc#newcode138 net/base/backoff_entry.cc:138: delay = std::max(policy_->maximum_backoff_ms, On 2014/06/14 15:16:07, cbentzel wrote: > ...
6 years, 6 months ago (2014-06-14 15:30:47 UTC) #3
Nicolas Zea
On 2014/06/14 15:30:47, cbentzel wrote: > https://codereview.chromium.org/337803004/diff/1/net/base/backoff_entry.cc > File net/base/backoff_entry.cc (right): > > https://codereview.chromium.org/337803004/diff/1/net/base/backoff_entry.cc#newcode138 > ...
6 years, 6 months ago (2014-06-16 06:24:40 UTC) #4
cbentzel
On 2014/06/16 06:24:40, Nicolas Zea wrote: > On 2014/06/14 15:30:47, cbentzel wrote: > > https://codereview.chromium.org/337803004/diff/1/net/base/backoff_entry.cc ...
6 years, 6 months ago (2014-06-16 14:32:48 UTC) #5
Ryan Sleevi
When I think overflow concerns, I think "Gee, base/numerics/safe_math.h sure is great" ;) https://codereview.chromium.org/337803004/diff/1/net/base/backoff_entry.cc File ...
6 years, 6 months ago (2014-06-16 17:20:48 UTC) #6
Nicolas Zea
PTAL. I've gone ahead and tried to do all the overflow checking at once using ...
6 years, 6 months ago (2014-06-16 20:27:25 UTC) #7
cbentzel
https://codereview.chromium.org/337803004/diff/100001/net/base/backoff_entry.cc File net/base/backoff_entry.cc (right): https://codereview.chromium.org/337803004/diff/100001/net/base/backoff_entry.cc#newcode148 net/base/backoff_entry.cc:148: base::internal::CheckedNumeric<int64> checked_release_time_us = NaN to integer conversion is undefined, ...
6 years, 6 months ago (2014-06-16 21:08:32 UTC) #8
Ryan Sleevi
https://codereview.chromium.org/337803004/diff/100001/net/base/backoff_entry.cc File net/base/backoff_entry.cc (right): https://codereview.chromium.org/337803004/diff/100001/net/base/backoff_entry.cc#newcode157 net/base/backoff_entry.cc:157: policy_->maximum_backoff_ms Can't this still overflow? https://codereview.chromium.org/337803004/diff/100001/net/base/backoff_entry.cc#newcode166 net/base/backoff_entry.cc:166: base::TimeTicks() + ...
6 years, 6 months ago (2014-06-16 22:12:47 UTC) #9
Nicolas Zea
https://codereview.chromium.org/337803004/diff/100001/net/base/backoff_entry.cc File net/base/backoff_entry.cc (right): https://codereview.chromium.org/337803004/diff/100001/net/base/backoff_entry.cc#newcode148 net/base/backoff_entry.cc:148: base::internal::CheckedNumeric<int64> checked_release_time_us = On 2014/06/16 21:08:32, cbentzel wrote: > ...
6 years, 6 months ago (2014-06-17 00:33:29 UTC) #10
Ryan Sleevi
https://codereview.chromium.org/337803004/diff/100001/net/base/backoff_entry.cc File net/base/backoff_entry.cc (right): https://codereview.chromium.org/337803004/diff/100001/net/base/backoff_entry.cc#newcode148 net/base/backoff_entry.cc:148: base::internal::CheckedNumeric<int64> checked_release_time_us = On 2014/06/17 00:33:29, Nicolas Zea wrote: ...
6 years, 6 months ago (2014-06-17 20:02:12 UTC) #11
Nicolas Zea
PTAL https://codereview.chromium.org/337803004/diff/100001/net/base/backoff_entry.cc File net/base/backoff_entry.cc (right): https://codereview.chromium.org/337803004/diff/100001/net/base/backoff_entry.cc#newcode157 net/base/backoff_entry.cc:157: policy_->maximum_backoff_ms On 2014/06/17 20:02:12, Ryan Sleevi wrote: > ...
6 years, 6 months ago (2014-06-17 21:31:44 UTC) #12
cbentzel
LGTM Thanks for discovering the issue and cleaning up BackoffEntry.
6 years, 6 months ago (2014-06-18 18:48:22 UTC) #13
Nicolas Zea
The CQ bit was checked by zea@chromium.org
6 years, 6 months ago (2014-06-18 19:01:00 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/zea@chromium.org/337803004/160001
6 years, 6 months ago (2014-06-18 19:02:14 UTC) #15
Nicolas Zea
6 years, 6 months ago (2014-06-18 19:58:46 UTC) #16
Message was sent while issue was closed.
Committed patchset #3 manually as r278153 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698