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

Issue 2519473002: Fixes the cache lock issue. (Closed)

Created:
4 years, 1 month ago by shivanisha
Modified:
3 years, 8 months ago
CC:
cbentzel+watch_chromium.org, chromium-reviews, devtools-reviews_chromium.org, gavinp+disk_chromium.org, kinuko+cache_chromium.org, pfeldman
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fixes the cache lock issue such that multiple transactions can start consuming the response data via a single network transaction. Design document: https://docs.google.com/document/d/1KHT2sQ2ASTs-_t1xvptn2anUDx7FOo8Dz8NKpkuWtsE/edit?usp=sharing BUG=472740

Patch Set 1 : Initial patch #

Total comments: 45

Patch Set 2 : Josh's initial feedback incorporated. #

Patch Set 3 : Making CacheWriteFailedSharedWriters return a std::unique_ptr instead of raw pointer so that it is … #

Patch Set 4 : Added traces and net log in HttpCache::Transaction for shared events. #

Patch Set 5 : Redesigned the fix using DataAccess class for eliminating Orphan API.(Rebased till refs/heads/master@{#442607}) #

Total comments: 47

Patch Set 6 : Removing the need for SharedWriters to destroy itself. #

Patch Set 7 : Feedback incorporated (Rebased till refs/heads/master@{#446065}) #

Total comments: 36

Patch Set 8 : Test only change to fix a memory leak. #

Total comments: 25

Patch Set 9 : Josh's early feedback addressed. #

Total comments: 4

Patch Set 10 : Feedback addressed #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3436 lines, -349 lines) Patch
M net/BUILD.gn View 1 2 3 4 5 6 2 chunks +3 lines, -0 lines 0 comments Download
M net/base/load_states_list.h View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -3 lines 0 comments Download
M net/http/http_cache.h View 1 2 3 4 5 6 7 8 9 6 chunks +56 lines, -6 lines 0 comments Download
M net/http/http_cache.cc View 1 2 3 4 5 6 7 8 9 16 chunks +170 lines, -37 lines 0 comments Download
A net/http/http_cache_shared_writers.h View 1 2 3 4 5 6 7 8 9 1 chunk +266 lines, -0 lines 0 comments Download
A net/http/http_cache_shared_writers.cc View 1 2 3 4 5 6 7 8 9 1 chunk +708 lines, -0 lines 0 comments Download
A net/http/http_cache_shared_writers_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1244 lines, -0 lines 0 comments Download
M net/http/http_cache_transaction.h View 1 2 3 4 5 6 7 8 11 chunks +102 lines, -9 lines 0 comments Download
M net/http/http_cache_transaction.cc View 1 2 3 4 5 6 7 8 9 41 chunks +538 lines, -106 lines 0 comments Download
M net/http/http_cache_unittest.cc View 1 2 3 4 5 6 7 41 chunks +238 lines, -185 lines 0 comments Download
M net/http/http_response_info.h View 1 2 3 4 5 6 1 chunk +5 lines, -0 lines 0 comments Download
M net/http/http_transaction.h View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M net/http/http_transaction_test_util.h View 1 2 3 4 4 chunks +13 lines, -1 line 0 comments Download
M net/http/http_transaction_test_util.cc View 1 2 3 4 4 chunks +7 lines, -1 line 0 comments Download
M net/log/net_log_event_type_list.h View 1 2 3 4 5 6 1 chunk +10 lines, -0 lines 0 comments Download
M net/url_request/url_request_http_job_unittest.cc View 1 2 3 4 1 chunk +53 lines, -0 lines 0 comments Download
M net/url_request/url_request_unittest.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 6 2 chunks +18 lines, -0 lines 0 comments Download

Messages

Total messages: 106 (63 generated)
shivanisha
Please take a look. Thanks! Its a large CL so please feel free to let ...
4 years ago (2016-12-06 13:30:50 UTC) #32
jkarlin
Just some super early feedback. PTAL at the request to move the SharedWriters class out ...
4 years ago (2016-12-06 18:08:18 UTC) #35
jkarlin
One thought that I keep coming back to: Could the SharedWriters be renamed to SharedNetworkTransaction ...
4 years ago (2016-12-06 21:06:28 UTC) #36
shivanisha
https://codereview.chromium.org/2519473002/diff/120001/chrome/browser/devtools/devtools_network_transaction.h File chrome/browser/devtools/devtools_network_transaction.h (right): https://codereview.chromium.org/2519473002/diff/120001/chrome/browser/devtools/devtools_network_transaction.h#newcode60 chrome/browser/devtools/devtools_network_transaction.h:60: void Orphan(std::unique_ptr<HttpTransaction> trans) override; On 2016/12/06 at 18:08:17, jkarlin ...
4 years ago (2016-12-06 21:53:35 UTC) #39
shivanisha
On 2016/12/06 at 21:53:35, shivanisha wrote: > https://codereview.chromium.org/2519473002/diff/120001/chrome/browser/devtools/devtools_network_transaction.h > File chrome/browser/devtools/devtools_network_transaction.h (right): > > https://codereview.chromium.org/2519473002/diff/120001/chrome/browser/devtools/devtools_network_transaction.h#newcode60 ...
4 years ago (2016-12-06 21:56:46 UTC) #40
shivanisha
https://codereview.chromium.org/2519473002/diff/120001/net/http/http_cache_transaction.cc File net/http/http_cache_transaction.cc (right): https://codereview.chromium.org/2519473002/diff/120001/net/http/http_cache_transaction.cc#newcode3388 net/http/http_cache_transaction.cc:3388: cache_->FinalizeDoomedSharedWriter(entry_); On 2016/12/06 at 21:53:35, shivanisha wrote: > On ...
4 years ago (2016-12-07 00:09:02 UTC) #41
jkarlin
https://codereview.chromium.org/2519473002/diff/120001/net/http/http_cache_transaction.cc File net/http/http_cache_transaction.cc (right): https://codereview.chromium.org/2519473002/diff/120001/net/http/http_cache_transaction.cc#newcode3387 net/http/http_cache_transaction.cc:3387: if (orphaned && finalize_doomed_) { On 2016/12/06 21:53:35, shivanisha ...
4 years ago (2016-12-07 01:09:04 UTC) #42
shivanisha
On 2016/12/06 at 21:06:28, jkarlin wrote: > One thought that I keep coming back to: ...
4 years ago (2016-12-07 19:04:45 UTC) #45
shivanisha
Created patch 3 which changes CacheWriteFailedSharedWriters to return a std::unique_ptr instead of a raw pointer ...
4 years ago (2016-12-08 17:37:56 UTC) #46
shivanisha
As per in-person and mail discussions on the earlier CL, this new patch eliminates the ...
3 years, 11 months ago (2017-01-12 20:10:19 UTC) #56
shivanisha
On 2017/01/12 at 20:10:19, shivanisha wrote: > As per in-person and mail discussions on the ...
3 years, 11 months ago (2017-01-13 20:49:08 UTC) #57
shivanisha
Adding David. davidben@, PTAL, Thanks!
3 years, 11 months ago (2017-01-18 21:49:57 UTC) #59
Randy Smith (Not in Mondays)
Shivani: I think the biggest bang for the buck for me on this review is ...
3 years, 11 months ago (2017-01-19 00:53:43 UTC) #60
shivanisha
https://codereview.chromium.org/2519473002/diff/220001/net/http/http_cache.h File net/http/http_cache.h (right): https://codereview.chromium.org/2519473002/diff/220001/net/http/http_cache.h#newcode23 net/http/http_cache.h:23: #include <utility> On 2017/01/19 at 00:53:42, Randy Smith - ...
3 years, 11 months ago (2017-01-19 21:13:06 UTC) #61
Randy Smith (Not in Mondays)
On 2017/01/19 21:13:06, shivanisha wrote: > https://codereview.chromium.org/2519473002/diff/220001/net/http/http_cache.h > File net/http/http_cache.h (right): > > https://codereview.chromium.org/2519473002/diff/220001/net/http/http_cache.h#newcode23 > ...
3 years, 11 months ago (2017-01-19 21:17:31 UTC) #62
shivanisha
On 2017/01/19 at 21:13:06, shivanisha wrote: > https://codereview.chromium.org/2519473002/diff/220001/net/http/http_cache.h > File net/http/http_cache.h (right): > > https://codereview.chromium.org/2519473002/diff/220001/net/http/http_cache.h#newcode23 ...
3 years, 11 months ago (2017-01-19 21:19:01 UTC) #63
Randy Smith (Not in Mondays)
> Its strange. I wrote up the response to the high level comments and press ...
3 years, 11 months ago (2017-01-19 21:19:39 UTC) #64
shivanisha
Thanks Randy for the initial comments. Responses to the high level comments are inline and ...
3 years, 11 months ago (2017-01-19 21:38:37 UTC) #65
shivanisha
https://codereview.chromium.org/2519473002/diff/220001/net/http/http_cache_shared_writers.cc File net/http/http_cache_shared_writers.cc (right): https://codereview.chromium.org/2519473002/diff/220001/net/http/http_cache_shared_writers.cc#newcode171 net/http/http_cache_shared_writers.cc:171: next_state_ = STATE_CACHE_WRITE_DATA; I remember talking to others about ...
3 years, 11 months ago (2017-01-20 16:00:09 UTC) #66
shivanisha
* As discussed by VC, I'm concerned by SharedWriters having control of its own destruction ...
3 years, 11 months ago (2017-01-20 19:53:27 UTC) #69
shivanisha
3 years, 11 months ago (2017-01-20 19:54:23 UTC) #70
Randy Smith (Not in Mondays)
On 2017/01/19 21:38:37, shivanisha wrote: > Thanks Randy for the initial comments. Responses to the ...
3 years, 11 months ago (2017-01-20 19:54:24 UTC) #71
Randy Smith (Not in Mondays)
https://codereview.chromium.org/2519473002/diff/220001/net/http/http_cache.h File net/http/http_cache.h (right): https://codereview.chromium.org/2519473002/diff/220001/net/http/http_cache.h#newcode23 net/http/http_cache.h:23: #include <utility> On 2017/01/19 21:13:06, shivanisha wrote: > On ...
3 years, 11 months ago (2017-01-20 19:54:32 UTC) #72
shivanisha
The latest patch removes the need for Shared Writers to delete itself. Functions invoked on ...
3 years, 11 months ago (2017-01-20 20:07:30 UTC) #73
Randy Smith (Not in Mondays)
On 2017/01/20 20:07:30, shivanisha wrote: > The latest patch removes the need for Shared Writers ...
3 years, 11 months ago (2017-01-20 20:26:45 UTC) #74
shivanisha
> * DataAccess seems like it does very few things: It owns the > HttpNetworkTransaction, ...
3 years, 11 months ago (2017-01-20 21:27:04 UTC) #75
shivanisha
On 2017/01/20 20:07:30, shivanisha wrote: > The latest patch removes the need for Shared Writers ...
3 years, 11 months ago (2017-01-20 21:28:37 UTC) #76
shivanisha
https://codereview.chromium.org/2519473002/diff/220001/net/http/http_cache.h File net/http/http_cache.h (right): https://codereview.chromium.org/2519473002/diff/220001/net/http/http_cache.h#newcode23 net/http/http_cache.h:23: #include <utility> Removed the include. https://codereview.chromium.org/2519473002/diff/220001/net/http/http_cache.h#newcode438 net/http/http_cache.h:438: // N/A ...
3 years, 11 months ago (2017-01-25 19:46:13 UTC) #81
shivanisha
https://codereview.chromium.org/2519473002/diff/220001/net/http/http_cache_shared_writers.cc File net/http/http_cache_shared_writers.cc (right): https://codereview.chromium.org/2519473002/diff/220001/net/http/http_cache_shared_writers.cc#newcode51 net/http/http_cache_shared_writers.cc:51: validating_transaction_ = transaction; Other reviewers, any thoughts on this?
3 years, 11 months ago (2017-01-25 19:50:09 UTC) #82
jkarlin
> * As I mention below, I'd like to explore whether it makes sense to ...
3 years, 10 months ago (2017-02-01 17:29:25 UTC) #89
shivanisha
On 2017/02/01 at 17:29:25, jkarlin wrote: > > * As I mention below, I'd like ...
3 years, 10 months ago (2017-02-01 17:50:38 UTC) #90
jkarlin
Read() can be defined however we want right? It doesn't need to just return a ...
3 years, 10 months ago (2017-02-01 17:53:37 UTC) #91
shivanisha
On 2017/02/01 at 17:53:37, jkarlin wrote: > Read() can be defined however we want right? ...
3 years, 10 months ago (2017-02-01 17:58:21 UTC) #92
jkarlin
On 2017/02/01 17:58:21, shivanisha wrote: > On 2017/02/01 at 17:53:37, jkarlin wrote: > > Read() ...
3 years, 10 months ago (2017-02-01 18:42:54 UTC) #93
shivanisha
On 2017/02/01 at 18:42:54, jkarlin wrote: > On 2017/02/01 17:58:21, shivanisha wrote: > > On ...
3 years, 10 months ago (2017-02-01 18:46:01 UTC) #94
jkarlin
Some early notes from a previous patchset. Sending before starting on the latest patchset. https://codereview.chromium.org/2519473002/diff/260001/net/base/load_states_list.h ...
3 years, 10 months ago (2017-02-03 18:26:20 UTC) #95
shivanisha
https://codereview.chromium.org/2519473002/diff/260001/net/base/load_states_list.h File net/base/load_states_list.h (right): https://codereview.chromium.org/2519473002/diff/260001/net/base/load_states_list.h#newcode42 net/base/load_states_list.h:42: // same resource, the requests eligible for shared writing ...
3 years, 10 months ago (2017-02-06 21:14:11 UTC) #96
jkarlin
Here are a few more https://codereview.chromium.org/2519473002/diff/280001/net/http/http_cache.cc File net/http/http_cache.cc (right): https://codereview.chromium.org/2519473002/diff/280001/net/http/http_cache.cc#newcode816 net/http/http_cache.cc:816: if (entry->shared_writers->AddTransaction(trans)) { Perhaps ...
3 years, 10 months ago (2017-02-07 15:20:31 UTC) #97
shivanisha
Addressed Josh's most recent feedback and also re-organized functions in http_cache_shared_writers.cc such that they are ...
3 years, 10 months ago (2017-02-07 20:56:48 UTC) #98
jkarlin
I see a way that we can split this into something more manageable for review. ...
3 years, 10 months ago (2017-02-16 14:35:08 UTC) #100
shivanisha
On 2017/02/16 at 14:35:08, jkarlin wrote: > I see a way that we can split ...
3 years, 9 months ago (2017-03-07 12:45:07 UTC) #101
jkarlin
Removed myself as reviewer since this CL is overcome by events.
3 years, 8 months ago (2017-04-11 11:32:59 UTC) #105
shivanisha
3 years, 8 months ago (2017-04-11 12:47:52 UTC) #106
On 2017/04/11 at 11:32:59, jkarlin wrote:
> Removed myself as reviewer since this CL is overcome by events.

Closing this CL since fixing the cache lock is now being done as part of three
separate CLs:
- Allowing parallel validation for all requests. CL
https://codereview.chromium.org/2721933002
- Dooming and creating entry for requests that do not match during validation
phase. CL https://codereview.chromium.org/2774603003/
- Allowing parallel writing. (Work in progress)

Powered by Google App Engine
This is Rietveld 408576698