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

Issue 2218403002: Change database scheme - add state and start tracking (Closed)

Created:
4 years, 4 months ago by Pete Williamson
Modified:
4 years, 4 months ago
Reviewers:
fgorski, dougarnett, chili
CC:
chromium-reviews, romax+watch_chromium.org, fgorski+watch_chromium.org, dewittj+watch_chromium.org, petewil+watch_chromium.org, chili+watch_chromium.org, dimich+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Change database scheme - add state and start tracking To be able to individually pause requests, we need a "PAUSED" state. It needs to be persisted, so we need to store it in our RequestQueue, which is the only persistent storage the BackgroundOfflining system has. While we are changing the schema, we are also adding a new field to keep track of how often a request has been started. If a request casues the pre-reneder to crash, we don't have code to detect the crash, and we will just retry later. To avoid getting stuck in an infinite crashing loop, we only allow requests to start so many times. Currently, we can't tell the difference between a crash and chromium getting swapped out of memory, so this will have some false positives, which is why we chose the limit to be higher than the completed limit. We split the existing attempt count field into started_attempt_count and completed_attempt_count. BUG=610521 Committed: https://crrev.com/47cd270d10b49ebdaea567566f8044ae5a89ef9e Cr-Commit-Position: refs/heads/master@{#410521}

Patch Set 1 #

Patch Set 2 : Delete old database if any #

Total comments: 38

Patch Set 3 : CR feedback per FGorski and Chili #

Patch Set 4 : remove comment #

Patch Set 5 : Stop clearing last request time #

Total comments: 2

Messages

Total messages: 30 (16 generated)
Pete Williamson
4 years, 4 months ago (2016-08-08 02:14:37 UTC) #10
fgorski
https://codereview.chromium.org/2218403002/diff/20001/components/offline_pages/background/offliner_policy.h File components/offline_pages/background/offliner_policy.h (right): https://codereview.chromium.org/2218403002/diff/20001/components/offline_pages/background/offliner_policy.h#newcode59 components/offline_pages/background/offliner_policy.h:59: // The max number of times we will *start* ...
4 years, 4 months ago (2016-08-08 17:48:06 UTC) #11
chili
kind of drive-by =) https://codereview.chromium.org/2218403002/diff/20001/components/offline_pages/background/request_picker.cc File components/offline_pages/background/request_picker.cc (right): https://codereview.chromium.org/2218403002/diff/20001/components/offline_pages/background/request_picker.cc#newcode92 components/offline_pages/background/request_picker.cc:92: // reqeust. tiny nit - ...
4 years, 4 months ago (2016-08-08 18:17:01 UTC) #13
Pete Williamson
https://codereview.chromium.org/2218403002/diff/20001/components/offline_pages/background/offliner_policy.h File components/offline_pages/background/offliner_policy.h (right): https://codereview.chromium.org/2218403002/diff/20001/components/offline_pages/background/offliner_policy.h#newcode59 components/offline_pages/background/offliner_policy.h:59: // The max number of times we will *start* ...
4 years, 4 months ago (2016-08-08 18:44:29 UTC) #14
Pete Williamson
https://codereview.chromium.org/2218403002/diff/20001/components/offline_pages/background/save_page_request_unittest.cc File components/offline_pages/background/save_page_request_unittest.cc (right): https://codereview.chromium.org/2218403002/diff/20001/components/offline_pages/background/save_page_request_unittest.cc#newcode70 components/offline_pages/background/save_page_request_unittest.cc:70: ASSERT_EQ(base::Time(), request.last_attempt_time()); // TODO: flaky? On 2016/08/08 18:44:29, Pete ...
4 years, 4 months ago (2016-08-08 18:53:12 UTC) #15
fgorski
lgtm after you sort out which way to go with last_attempt_time_. https://codereview.chromium.org/2218403002/diff/20001/components/offline_pages/background/save_page_request.cc File components/offline_pages/background/save_page_request.cc (right): ...
4 years, 4 months ago (2016-08-08 22:35:34 UTC) #16
Pete Williamson
https://codereview.chromium.org/2218403002/diff/20001/components/offline_pages/background/save_page_request.cc File components/offline_pages/background/save_page_request.cc (right): https://codereview.chromium.org/2218403002/diff/20001/components/offline_pages/background/save_page_request.cc#newcode81 components/offline_pages/background/save_page_request.cc:81: state_ = RequestState::PAUSED; On 2016/08/08 22:35:33, fgorski wrote: > ...
4 years, 4 months ago (2016-08-08 22:56:56 UTC) #17
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/2218403002/80001
4 years, 4 months ago (2016-08-08 22:57:42 UTC) #20
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/206061)
4 years, 4 months ago (2016-08-09 00:17:38 UTC) #22
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/2218403002/80001
4 years, 4 months ago (2016-08-09 00:19:02 UTC) #24
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 4 months ago (2016-08-09 02:15:11 UTC) #25
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/47cd270d10b49ebdaea567566f8044ae5a89ef9e Cr-Commit-Position: refs/heads/master@{#410521}
4 years, 4 months ago (2016-08-09 02:18:06 UTC) #27
dougarnett
https://codereview.chromium.org/2218403002/diff/80001/components/offline_pages/background/save_page_request.cc File components/offline_pages/background/save_page_request.cc (right): https://codereview.chromium.org/2218403002/diff/80001/components/offline_pages/background/save_page_request.cc#newcode61 components/offline_pages/background/save_page_request.cc:61: state_ = RequestState::PRERENDERING; I don't understand why this internally ...
4 years, 4 months ago (2016-08-19 20:21:26 UTC) #29
Pete Williamson
4 years, 4 months ago (2016-08-22 16:33:29 UTC) #30
Message was sent while issue was closed.
https://codereview.chromium.org/2218403002/diff/80001/components/offline_page...
File components/offline_pages/background/save_page_request.cc (right):

https://codereview.chromium.org/2218403002/diff/80001/components/offline_page...
components/offline_pages/background/save_page_request.cc:61: state_ =
RequestState::PRERENDERING;
On 2016/08/19 20:21:26, dougarnett wrote:
> I don't understand why this internally sets a specifically named PRERENDERING
> state (vs. some more generic IN_PROGRESS or LOADING). This method doesn't know
> the implementation for loading so it is guessing. I think it should either be
a
> generally named state or else the specific state would need to be passed in. 

The thinking was that we might someday have other states such as SAVING_PAGE, or
other types of pre-renderer.  So, we can pass in the state to the
MarkAttemptStarted method in a future change, or we could wait until we
introduce more states to make the change.

Powered by Google App Engine
This is Rietveld 408576698