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

Issue 2898983006: Fix and refactor HttpServerPropertiesImpl's alternative services brokenness expiration behavior (Closed)

Created:
3 years, 7 months ago by wangyix1
Modified:
3 years, 6 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, net-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix and refactor HttpServerPropertiesImpl's alternative services brokenness expiration behavior. One of HttpServerPropertiesImpl's responsibilities is to store HTTP alternative services that have failed and keeps track of their time-until-retry (i.e. when their brokenness expires). The broken alt-svcs and their respective expiration times are kept in a list ordered by expiration time. When the expiration task runs, it drops items from the front of the list until the expiration time of the head alt-svc is no longer in the past. Turns out this list was kept in insertion order as opposed to expiration-sorted order. This change keeps this queue in expiration-sorted order, as expected. The additional logic added to implement the above change led to a refactor of HttpServerPropertiesImpl: its broken alt-svc logic is put in its own class, BrokenAlternativeServices. BUG=724302 Review-Url: https://codereview.chromium.org/2898983006 Cr-Commit-Position: refs/heads/master@{#476475} Committed: https://chromium.googlesource.com/chromium/src/+/64ccc57c1a20a8b2804df8a4e9be42b33b5b8f61

Patch Set 1 #

Total comments: 26

Patch Set 2 : Renamed HttpBrokenAlternativeServicesManager to BrokenAlternativeServices #

Patch Set 3 : Fixed Ryan's comments #

Patch Set 4 : Fixed some mistakes in unit-test code #

Total comments: 46

Patch Set 5 : Fixed rch's comments from ps4 #

Patch Set 6 : Added checks for contents of expired_alt_svcs_ in BrokenAlternativeServicesTest #

Total comments: 34

Patch Set 7 : Fixed rch's comments from ps6 #

Total comments: 4

Patch Set 8 : Fixed rch's comments from ps7 #

Patch Set 9 : Inlined all uses of BROKEN_ALT_SVC_EXPIRATION_DELAY. Unrolled loops to reduce logic in BrokenAltern… #

Total comments: 16

Patch Set 10 : Rebase #

Patch Set 11 : Fixed cherie's comments from ps9; added BrokenAlternativeServicesTest.ScheduleExpireTaskAfterExpire #

Unified diffs Side-by-side diffs Delta from patch set Stats (+810 lines, -295 lines) Patch
M net/BUILD.gn View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -0 lines 0 comments Download
A + net/http/broken_alternative_services.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +106 lines, -146 lines 0 comments Download
A net/http/broken_alternative_services.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +181 lines, -0 lines 0 comments Download
A net/http/broken_alternative_services_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +366 lines, -0 lines 0 comments Download
M net/http/http_server_properties_impl.h View 1 2 3 4 5 6 7 8 9 10 6 chunks +14 lines, -22 lines 0 comments Download
M net/http/http_server_properties_impl.cc View 1 2 3 4 5 6 7 8 9 3 chunks +42 lines, -118 lines 0 comments Download
M net/http/http_server_properties_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 8 chunks +98 lines, -9 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 48 (29 generated)
wangyix1
PTAL
3 years, 7 months ago (2017-05-25 01:29:17 UTC) #3
Ryan Hamilton
Looking good! A bunch of nits and I need to spend a bit more time ...
3 years, 7 months ago (2017-05-25 03:03:51 UTC) #4
wangyix1
PTAL https://codereview.chromium.org/2898983006/diff/1/net/http/http_broken_alternative_services_manager.h File net/http/http_broken_alternative_services_manager.h (right): https://codereview.chromium.org/2898983006/diff/1/net/http/http_broken_alternative_services_manager.h#newcode23 net/http/http_broken_alternative_services_manager.h:23: class NET_EXPORT HttpBrokenAlternativeServicesManager { On 2017/05/25 03:03:50, Ryan ...
3 years, 7 months ago (2017-05-26 01:14:25 UTC) #11
Ryan Hamilton
Looking good, though I discovered that we can probably just use base::TickClock to make life ...
3 years, 7 months ago (2017-05-26 03:52:09 UTC) #12
wangyix1
Fixed rch's comments from ps4, PTAL https://codereview.chromium.org/2898983006/diff/180001/net/http/broken_alternative_services.cc File net/http/broken_alternative_services.cc (right): https://codereview.chromium.org/2898983006/diff/180001/net/http/broken_alternative_services.cc#newcode38 net/http/broken_alternative_services.cc:38: ~DefaultClock() override {} ...
3 years, 7 months ago (2017-05-27 01:20:11 UTC) #13
Ryan Hamilton
Lookin' good. The main code looks done modulo a few nits. A couple of comments ...
3 years, 6 months ago (2017-05-27 13:28:16 UTC) #14
wangyix1
Fixed comments from ps6, PTAL. https://codereview.chromium.org/2898983006/diff/180001/net/http/broken_alternative_services.cc File net/http/broken_alternative_services.cc (right): https://codereview.chromium.org/2898983006/diff/180001/net/http/broken_alternative_services.cc#newcode161 net/http/broken_alternative_services.cc:161: } On 2017/05/27 13:28:15, ...
3 years, 6 months ago (2017-05-30 21:18:18 UTC) #16
Ryan Hamilton
Sweet. Almost there. One comment fix and a couple of test simplifications. https://codereview.chromium.org/2898983006/diff/220001/net/http/broken_alternative_services_unittest.cc File net/http/broken_alternative_services_unittest.cc ...
3 years, 6 months ago (2017-05-30 21:32:28 UTC) #17
wangyix1
Inlined BROKEN_ALT_SVC_EXPIRE_DELAYS and unrolled loops to reduce logic in unit test. PTAL https://codereview.chromium.org/2898983006/diff/220001/net/http/broken_alternative_services_unittest.cc File net/http/broken_alternative_services_unittest.cc ...
3 years, 6 months ago (2017-05-30 23:57:50 UTC) #18
Ryan Hamilton
lgtm
3 years, 6 months ago (2017-05-31 00:20:28 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2898983006/300001
3 years, 6 months ago (2017-05-31 00:24:41 UTC) #21
commit-bot: I haz the power
Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds/222006) ios-device-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, ...
3 years, 6 months ago (2017-05-31 00:27:45 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2898983006/320001
3 years, 6 months ago (2017-05-31 18:13:01 UTC) #26
Zhongyi Shi
Looks great! Just a couple of nits. https://codereview.chromium.org/2898983006/diff/300001/net/http/broken_alternative_services.cc File net/http/broken_alternative_services.cc (right): https://codereview.chromium.org/2898983006/diff/300001/net/http/broken_alternative_services.cc#newcode24 net/http/broken_alternative_services.cc:24: DCHECK(broken_count >= ...
3 years, 6 months ago (2017-05-31 18:54:15 UTC) #27
wangyix1
Fixed zhongyi's comments from ps9. PTAL https://codereview.chromium.org/2898983006/diff/300001/net/http/broken_alternative_services.cc File net/http/broken_alternative_services.cc (right): https://codereview.chromium.org/2898983006/diff/300001/net/http/broken_alternative_services.cc#newcode24 net/http/broken_alternative_services.cc:24: DCHECK(broken_count >= 0); ...
3 years, 6 months ago (2017-06-01 20:05:49 UTC) #34
Zhongyi Shi
LGTM! Thanks for fixing this!
3 years, 6 months ago (2017-06-01 20:51:05 UTC) #37
Zhongyi Shi
Could you update your cl description as well? At least BrokenAlternativeServiceManager is not a thing ...
3 years, 6 months ago (2017-06-01 20:52:38 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2898983006/360001
3 years, 6 months ago (2017-06-01 23:07:45 UTC) #45
commit-bot: I haz the power
3 years, 6 months ago (2017-06-01 23:14:30 UTC) #48
Message was sent while issue was closed.
Committed patchset #11 (id:360001) as
https://chromium.googlesource.com/chromium/src/+/64ccc57c1a20a8b2804df8a4e9be...

Powered by Google App Engine
This is Rietveld 408576698