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

Issue 4194001: Implement exponential back-off mechanism and enforce it at the URLRequestHttpJob level. (Closed)

Created:
10 years, 1 month ago by yzshen
Modified:
9 years, 7 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, darin-cc_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

Implement exponential back-off mechanism and enforce it at the URLRequestHttpJob level for all outgoing HTTP requests. The reason why to make this change is that we need back-off logic at a lower enough level to manage all outgoing HTTP traffic, so that the browser won't cause any DDoS attack. This change: 1) patches http://codereview.chromium.org/2487001/show, which is the exponential back-off implementation. 2) resolves conflicts with URLFetcher, by removing its own back-off logic: -- removes url_fetcher_protect.{h,cc}; -- integrates the sliding window mechanism of URLFetcherProtectEntry into RequestThrottlerEntry. 3) resolves conflicts with CloudPrintURLFetcher. 4) makes unit tests of CloudPrintURLFetcher, URLFetcher and URLRequest work. BUG=none TEST=pass all existing tests and also the newly-added request_throttler_unittest.cc

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 10

Patch Set 3 : '' #

Total comments: 3

Patch Set 4 : '' #

Total comments: 19

Patch Set 5 : '' #

Patch Set 6 : '' #

Total comments: 14

Patch Set 7 : '' #

Patch Set 8 : '' #

Patch Set 9 : '' #

Patch Set 10 : '' #

Total comments: 38

Patch Set 11 : '' #

Total comments: 13

Patch Set 12 : '' #

Total comments: 4

Patch Set 13 : '' #

Total comments: 25

Patch Set 14 : '' #

Patch Set 15 : '' #

Patch Set 16 : '' #

Patch Set 17 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1358 lines, -514 lines) Patch
M chrome/browser/google/google_url_tracker.cc View 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +5 lines, -8 lines 0 comments Download
M chrome/chrome_common.gypi View 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/common/net/url_fetcher.h View 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +10 lines, -0 lines 0 comments Download
M chrome/common/net/url_fetcher.cc View 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 14 chunks +107 lines, -26 lines 0 comments Download
D chrome/common/net/url_fetcher_protect.h View 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +0 lines, -152 lines 0 comments Download
D chrome/common/net/url_fetcher_protect.cc View 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +0 lines, -180 lines 0 comments Download
M chrome/common/net/url_fetcher_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 12 chunks +40 lines, -36 lines 0 comments Download
M chrome/service/cloud_print/cloud_print_consts.h View 8 9 10 11 12 13 14 15 16 2 chunks +2 lines, -4 lines 0 comments Download
M chrome/service/cloud_print/cloud_print_consts.cc View 8 9 10 11 12 13 14 15 16 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/service/cloud_print/cloud_print_proxy_backend.cc View 8 9 10 11 12 13 14 15 16 5 chunks +2 lines, -32 lines 0 comments Download
M chrome/service/cloud_print/cloud_print_url_fetcher.h View 8 9 10 11 12 13 14 15 16 3 chunks +4 lines, -9 lines 0 comments Download
M chrome/service/cloud_print/cloud_print_url_fetcher.cc View 8 9 10 11 12 13 14 15 16 7 chunks +16 lines, -26 lines 0 comments Download
M chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc View 8 9 10 11 12 13 14 15 16 9 chunks +26 lines, -25 lines 0 comments Download
M chrome/service/cloud_print/job_status_updater.cc View 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -1 line 0 comments Download
M chrome/service/cloud_print/printer_job_handler.cc View 8 9 10 11 12 13 14 15 16 6 chunks +6 lines, -6 lines 0 comments Download
M chrome_frame/metrics_service.cc View 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +0 lines, -1 line 0 comments Download
M net/base/net_error_list.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +3 lines, -0 lines 0 comments Download
M net/net.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +9 lines, -0 lines 0 comments Download
M net/url_request/url_request_http_job.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +4 lines, -0 lines 0 comments Download
M net/url_request/url_request_http_job.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5 chunks +18 lines, -2 lines 0 comments Download
A net/url_request/url_request_throttler_entry.h View 1 chunk +157 lines, -0 lines 0 comments Download
A net/url_request/url_request_throttler_entry.cc View 1 chunk +242 lines, -0 lines 0 comments Download
A net/url_request/url_request_throttler_entry_interface.h View 1 chunk +63 lines, -0 lines 0 comments Download
A net/url_request/url_request_throttler_header_adapter.h View 15 1 chunk +34 lines, -0 lines 0 comments Download
A net/url_request/url_request_throttler_header_adapter.cc View 15 1 chunk +27 lines, -0 lines 0 comments Download
A net/url_request/url_request_throttler_header_interface.h View 1 chunk +28 lines, -0 lines 0 comments Download
A net/url_request/url_request_throttler_manager.h View 1 chunk +101 lines, -0 lines 0 comments Download
A net/url_request/url_request_throttler_manager.cc View 1 chunk +107 lines, -0 lines 0 comments Download
A net/url_request/url_request_throttler_unittest.cc View 1 chunk +346 lines, -0 lines 0 comments Download

Messages

Total messages: 50 (0 generated)
yzshen
10 years, 1 month ago (2010-11-09 02:11:46 UTC) #1
joi
Hi Yuzhu, Great work. Just two high-level comments to get the ball rolling. I'm sorry ...
10 years, 1 month ago (2010-11-09 20:07:17 UTC) #2
yzshen
Hi, Joi. Thanks a lot for your comments! http://codereview.chromium.org/4194001/diff/15001/net/base/run_all_unittests.cc File net/base/run_all_unittests.cc (right): http://codereview.chromium.org/4194001/diff/15001/net/base/run_all_unittests.cc#newcode28 net/base/run_all_unittests.cc:28: Singleton<RequestThrottlerManager>::get()->DisableThrottlingByDefault(); ...
10 years, 1 month ago (2010-11-09 22:32:22 UTC) #3
joi
My concern with the sliding level at such a low level is exactly that it ...
10 years, 1 month ago (2010-11-09 22:34:31 UTC) #4
yzshen
Hi, Joi. Thanks for your suggestion! I will work on that and update the change ...
10 years, 1 month ago (2010-11-09 22:36:44 UTC) #5
yzshen
Hi, Joi. I have made change according to your suggestions. Please take another look. Thanks! ...
10 years, 1 month ago (2010-11-11 17:37:37 UTC) #6
eroman
Also adding pkasting/willchan who will likely want to comment. http://codereview.chromium.org/4194001/diff/15001/net/request_throttler/request_throttler_manager.cc File net/request_throttler/request_throttler_manager.cc (right): http://codereview.chromium.org/4194001/diff/15001/net/request_throttler/request_throttler_manager.cc#newcode50 net/request_throttler/request_throttler_manager.cc:50: ...
10 years, 1 month ago (2010-11-11 17:54:21 UTC) #7
Peter Kasting
On 2010/11/11 17:54:21, eroman wrote: > Also adding pkasting/willchan who will likely want to comment. ...
10 years, 1 month ago (2010-11-11 18:53:30 UTC) #8
Jói
Hi Yuzhu, I'm confused, I thought in this patch set you had moved the sliding ...
10 years, 1 month ago (2010-11-11 19:04:40 UTC) #9
eroman
On Thu, Nov 11, 2010 at 10:53 AM, <pkasting@chromium.org> wrote: > On 2010/11/11 17:54:21, eroman ...
10 years, 1 month ago (2010-11-11 19:22:58 UTC) #10
Peter Kasting
On 2010/11/11 19:22:58, eroman wrote: > I thought you were the original author of the ...
10 years, 1 month ago (2010-11-11 19:30:29 UTC) #11
willchan no longer on Chromium
I'm going to dive into the review later today. First question, why isn't all this ...
10 years, 1 month ago (2010-11-11 19:34:48 UTC) #12
yzshen
Hi, Joi. On Thu, Nov 11, 2010 at 11:04 AM, Jói Sigurðsson <joi@chromium.org> wrote: > ...
10 years, 1 month ago (2010-11-11 21:26:07 UTC) #13
yzshen
Hi, William. That sounds a good idea to me. Thanks for your suggestion! On Thu, ...
10 years, 1 month ago (2010-11-11 21:32:19 UTC) #14
yzshen
Hi, Eric. Thanks for your comments! http://codereview.chromium.org/4194001/diff/15001/net/request_throttler/request_throttler_manager.cc File net/request_throttler/request_throttler_manager.cc (right): http://codereview.chromium.org/4194001/diff/15001/net/request_throttler/request_throttler_manager.cc#newcode50 net/request_throttler/request_throttler_manager.cc:50: url_id += url.scheme(); ...
10 years, 1 month ago (2010-11-11 22:17:04 UTC) #15
eroman
http://codereview.chromium.org/4194001/diff/42001/net/request_throttler/request_throttler_entry.cc File net/request_throttler/request_throttler_entry.cc (right): http://codereview.chromium.org/4194001/diff/42001/net/request_throttler/request_throttler_entry.cc#newcode151 net/request_throttler/request_throttler_entry.cc:151: AutoLock auto_lock(lock_); On 2010/11/11 22:17:05, yzshen wrote: > On ...
10 years, 1 month ago (2010-11-11 23:57:14 UTC) #16
Jói
For the GetRecommendedDelayForNextRequest thing, I think URLFetcher is the only consumer, so your suggestion seems ...
10 years, 1 month ago (2010-11-12 00:10:04 UTC) #17
Jói
I went through the code again and I have some nits and suggestions, but overall ...
10 years, 1 month ago (2010-11-12 00:12:07 UTC) #18
yzshen
On 2010/11/11 23:57:14, eroman wrote: > http://codereview.chromium.org/4194001/diff/42001/net/request_throttler/request_throttler_entry.cc > File net/request_throttler/request_throttler_entry.cc (right): > > http://codereview.chromium.org/4194001/diff/42001/net/request_throttler/request_throttler_entry.cc#newcode151 > ...
10 years, 1 month ago (2010-11-12 00:49:53 UTC) #19
joi
> Please let me know whether you think this is a must and whether it ...
10 years, 1 month ago (2010-11-12 00:57:13 UTC) #20
yzshen
Hi, Joi. Thanks! >I didn't review all of the core logic in great detail, as ...
10 years, 1 month ago (2010-11-12 02:05:46 UTC) #21
Jói
Hi Yuzhu, Took a closer look at the sliding window code and some of the ...
10 years, 1 month ago (2010-11-12 19:14:24 UTC) #22
yzshen
Hi, Joi. Here are replies to part of the comments. It may take me some ...
10 years, 1 month ago (2010-11-12 21:28:33 UTC) #23
yzshen
Hi, reviewers. I have resolved conflicts with CloudPrintURLFetcher and updated the CL. Please take a ...
10 years, 1 month ago (2010-11-17 07:31:43 UTC) #24
eroman
I am going to be gone the next 2 days. apologies if I don't get ...
10 years, 1 month ago (2010-11-17 07:33:29 UTC) #25
Jói
LGTM > Joi: I agree with you that we should reconsider the back-off condition (part ...
10 years, 1 month ago (2010-11-17 16:39:18 UTC) #26
willchan no longer on Chromium
I'm still going through this changelist. You should update the changelist description, especially the first ...
10 years, 1 month ago (2010-11-17 20:32:33 UTC) #27
willchan no longer on Chromium
I'm still going through this, but I started looking at Eric's comments, and it looks ...
10 years, 1 month ago (2010-11-18 06:47:47 UTC) #28
yzshen
Hi, reviewers. I have removed all locks and made sure RequestThrottler* are only accessed on ...
10 years, 1 month ago (2010-11-19 23:51:35 UTC) #29
Jói
Mostly LGTM, I have a few nits and a couple of questions. Nice work removing ...
10 years, 1 month ago (2010-11-21 19:31:40 UTC) #30
yzshen
Thanks, Joi! http://codereview.chromium.org/4194001/diff/185002/chrome/common/net/url_fetcher.cc File chrome/common/net/url_fetcher.cc (right): http://codereview.chromium.org/4194001/diff/185002/chrome/common/net/url_fetcher.cc#newcode92 chrome/common/net/url_fetcher.cc:92: void StartURLRequest(); On 2010/11/21 19:31:40, Jói wrote: ...
10 years, 1 month ago (2010-11-22 17:35:01 UTC) #31
sanjeevr
Almost LGTM for the cloud print code. A couple of minor issues. http://codereview.chromium.org/4194001/diff/224001/chrome/service/cloud_print/cloud_print_url_fetcher.cc File chrome/service/cloud_print/cloud_print_url_fetcher.cc ...
10 years, 1 month ago (2010-11-22 19:09:25 UTC) #32
Jói
LGTM http://codereview.chromium.org/4194001/diff/185002/chrome/common/net/url_fetcher.cc File chrome/common/net/url_fetcher.cc (right): http://codereview.chromium.org/4194001/diff/185002/chrome/common/net/url_fetcher.cc#newcode145 chrome/common/net/url_fetcher.cc:145: base::TimeTicks backoff_release_time_; On 2010/11/22 17:35:01, yzshen wrote: > ...
10 years, 1 month ago (2010-11-22 21:16:27 UTC) #33
yzshen
http://codereview.chromium.org/4194001/diff/224001/chrome/service/cloud_print/cloud_print_url_fetcher.cc File chrome/service/cloud_print/cloud_print_url_fetcher.cc (right): http://codereview.chromium.org/4194001/diff/224001/chrome/service/cloud_print/cloud_print_url_fetcher.cc#newcode104 chrome/service/cloud_print/cloud_print_url_fetcher.cc:104: StartRequestNow(); On 2010/11/22 19:09:26, sanjeevr wrote: > We don't ...
10 years, 1 month ago (2010-11-22 22:59:17 UTC) #34
sanjeevr
On 2010/11/22 22:59:17, yzshen wrote: > http://codereview.chromium.org/4194001/diff/224001/chrome/service/cloud_print/cloud_print_url_fetcher.cc > File chrome/service/cloud_print/cloud_print_url_fetcher.cc (right): > > http://codereview.chromium.org/4194001/diff/224001/chrome/service/cloud_print/cloud_print_url_fetcher.cc#newcode104 > ...
10 years ago (2010-11-23 18:54:21 UTC) #35
willchan no longer on Chromium
I consulted with other networking folks. You need to rename your classes. Everything in net/ ...
10 years ago (2010-11-24 00:23:07 UTC) #36
joi
Hi Will, Thanks for doing such a thorough review. Please don't be too hard on ...
10 years ago (2010-11-24 00:29:14 UTC) #37
willchan no longer on Chromium
Yeah, I realized it's not yzshen's fault, since he inherited the code. I realize my ...
10 years ago (2010-11-24 00:50:26 UTC) #38
yzshen
Hi, William and Joi. Thanks for all your help and patience! William: I knew you ...
10 years ago (2010-11-24 01:12:12 UTC) #39
willchan no longer on Chromium
On Tue, Nov 23, 2010 at 5:12 PM, Yuzhu Shen <yzshen@google.com> wrote: > Hi, William ...
10 years ago (2010-11-24 01:43:59 UTC) #40
joi
Thanks guys! And yes, thanks for being a hardass Will - really focusing on quality ...
10 years ago (2010-11-24 01:54:46 UTC) #41
willchan no longer on Chromium
Need to take another look later tonight, but I don't think I'll have any functional ...
10 years ago (2010-11-24 03:10:29 UTC) #42
yzshen
> Another suggestion for the future is to use NetLog. It'll > be good to ...
10 years ago (2010-11-24 09:42:08 UTC) #43
willchan no longer on Chromium
After reading it some more, I'm stepping back and questioning the whole RequestThrottlerEntry stuff in ...
10 years ago (2010-11-24 10:14:50 UTC) #44
joi
Let me throw in a couple of things and let yzshen take the rest. > ...
10 years ago (2010-11-24 14:18:55 UTC) #45
Sigurður Ásgeirsson
On 2010/11/24 00:50:26, willchan wrote: > Yeah, I realized it's not yzshen's fault, since he ...
10 years ago (2010-11-24 14:32:47 UTC) #46
yzshen
Hi, William. Thanks! On Wed, Nov 24, 2010 at 2:14 AM, <willchan@chromium.org> wrote: > After ...
10 years ago (2010-11-24 19:03:20 UTC) #47
yzshen
http://codereview.chromium.org/4194001/diff/234001/net/url_request/request_throttler_header_adapter.h File net/url_request/request_throttler_header_adapter.h (right): http://codereview.chromium.org/4194001/diff/234001/net/url_request/request_throttler_header_adapter.h#newcode10 net/url_request/request_throttler_header_adapter.h:10: #include "base/scoped_ptr.h" On 2010/11/24 10:14:50, willchan wrote: > Don't ...
10 years ago (2010-11-24 19:09:30 UTC) #48
willchan no longer on Chromium
I've spoken to yzshen about this change. I'm fine with landing it now and iterating ...
10 years ago (2010-11-24 21:10:59 UTC) #49
yzshen
10 years ago (2010-11-24 22:41:32 UTC) #50
Hi, willchan.

Thanks!

On Wed, Nov 24, 2010 at 1:10 PM, <willchan@chromium.org> wrote:

> I've spoken to yzshen about this change.  I'm fine with landing it now and
> iterating on it.  I think we need to do some major changes to how the code
> is
> structured.  I'm not completely sure I've flushed out all the bugs, so we
> might
> run into issues for M9.  It'll be great if we can get some NetLog coverage
> here
> so we can debug any issues with about:net-internals.
>
I will work on it right away.


>
> LGTM, but with the understanding we need to make some potentially big
> changes.
> I will meet with yzshen next week in MV to discuss steps forward.
>

>
> http://codereview.chromium.org/4194001/
>

BTW: eroman is on vacation now. I have talked with him and he thinks I could
proceeds to land this CL with willchan's LGTM.


-- 
Best regards,
Yuzhu Shen.

Powered by Google App Engine
This is Rietveld 408576698