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

Issue 137493003: Appcache::OnCorruptionDetected handling (Closed)

Created:
6 years, 11 months ago by michaeln
Modified:
6 years, 10 months ago
Reviewers:
kinuko, jsbell
CC:
chromium-reviews, darin-cc_chromium.org
Visibility:
Public.

Description

Appcache::OnCorruptionDetected handling. The general idea is to delete everything and start over (reinitialize) if we notice corruption on disk. The is some pre-existing code to perform the reinitialization function, but that was only used in a more narrow case where the disk cache could not have been open. With the changes in this CL, reinitialization can be triggered pretty much at any time. * The AppCacheDatabase classes uses an SQLConnecton ErrorHandler to detect catastrophic errors (corruption). * The AppCacheStorageImpl's DatabaseTask class checks for having seen corruption during a task and initiates a heavy handed operation to delete everything and start over. * The AppCacheStorageImpl::InitTask also checks for the presence of a stale/undeletable DiskCache when there is no SQL database. If found, that also triggers reinitialization. * The AppCacheService class does exponential backoff to avoid thrashing the disk on repeated reinit attempts. * The AppCacheDiskCache class's Disable() method has been modified such that all file handles get released. TBR=jam BUG=318544 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=247967 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=248642

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Total comments: 1

Patch Set 7 : #

Patch Set 8 : #

Patch Set 9 : #

Patch Set 10 : #

Total comments: 18

Patch Set 11 : #

Total comments: 11

Patch Set 12 : #

Patch Set 13 : #

Total comments: 1

Patch Set 14 : #

Total comments: 3

Patch Set 15 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+512 lines, -78 lines) Patch
M content/content_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M webkit/browser/appcache/appcache_database.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +6 lines, -0 lines 0 comments Download
M webkit/browser/appcache/appcache_database.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 5 chunks +21 lines, -5 lines 0 comments Download
M webkit/browser/appcache/appcache_database_unittest.cc View 1 2 3 4 5 6 7 1 chunk +28 lines, -1 line 0 comments Download
M webkit/browser/appcache/appcache_disk_cache.h View 1 2 3 4 2 chunks +4 lines, -0 lines 0 comments Download
M webkit/browser/appcache/appcache_disk_cache.cc View 1 2 3 4 5 6 7 8 9 10 11 7 chunks +38 lines, -13 lines 0 comments Download
A webkit/browser/appcache/appcache_disk_cache_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +185 lines, -0 lines 0 comments Download
M webkit/browser/appcache/appcache_histograms.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M webkit/browser/appcache/appcache_histograms.cc View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M webkit/browser/appcache/appcache_service.h View 1 2 3 4 5 6 5 chunks +10 lines, -3 lines 0 comments Download
M webkit/browser/appcache/appcache_service.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +30 lines, -9 lines 0 comments Download
M webkit/browser/appcache/appcache_service_unittest.cc View 1 2 3 4 5 1 chunk +57 lines, -0 lines 0 comments Download
M webkit/browser/appcache/appcache_storage_impl.h View 1 2 3 4 5 3 chunks +4 lines, -3 lines 0 comments Download
M webkit/browser/appcache/appcache_storage_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 9 chunks +59 lines, -21 lines 0 comments Download
M webkit/browser/appcache/appcache_storage_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 9 chunks +64 lines, -23 lines 0 comments Download

Messages

Total messages: 39 (0 generated)
jsbell
https://codereview.chromium.org/137493003/diff/220001/webkit/browser/appcache/appcache_database.h File webkit/browser/appcache/appcache_database.h (right): https://codereview.chromium.org/137493003/diff/220001/webkit/browser/appcache/appcache_database.h#newcode89 webkit/browser/appcache/appcache_database.h:89: bool was_corruption_dectected(); typo: "dectected"
6 years, 11 months ago (2014-01-22 00:37:18 UTC) #1
michaeln
hi josh, ptal
6 years, 11 months ago (2014-01-24 01:38:51 UTC) #2
michaeln
https://codereview.chromium.org/137493003/diff/450001/webkit/browser/appcache/appcache_database.cc File webkit/browser/appcache/appcache_database.cc (right): https://codereview.chromium.org/137493003/diff/450001/webkit/browser/appcache/appcache_database.cc#newcode1231 webkit/browser/appcache/appcache_database.cc:1231: // For local testing, inject spurious errors and see ...
6 years, 11 months ago (2014-01-24 01:48:26 UTC) #3
jsbell
Some initial nits. I want to go through the patch again. https://codereview.chromium.org/137493003/diff/450001/webkit/browser/appcache/appcache_database.cc File webkit/browser/appcache/appcache_database.cc (right): ...
6 years, 11 months ago (2014-01-24 21:13:44 UTC) #4
jsbell
Overall lgtm with the various nits, and with the error generation removed, but this was ...
6 years, 11 months ago (2014-01-27 21:21:51 UTC) #5
michaeln
https://codereview.chromium.org/137493003/diff/450001/webkit/browser/appcache/appcache_database.cc File webkit/browser/appcache/appcache_database.cc (right): https://codereview.chromium.org/137493003/diff/450001/webkit/browser/appcache/appcache_database.cc#newcode207 webkit/browser/appcache/appcache_database.cc:207: is_recreating_(false), was_corruption_detected_(false) { On 2014/01/24 21:13:44, jsbell wrote: > ...
6 years, 10 months ago (2014-01-28 22:12:16 UTC) #6
michaeln
https://codereview.chromium.org/137493003/diff/450001/webkit/browser/appcache/appcache_service.cc File webkit/browser/appcache/appcache_service.cc (right): https://codereview.chromium.org/137493003/diff/450001/webkit/browser/appcache/appcache_service.cc#newcode497 webkit/browser/appcache/appcache_service.cc:497: next_reinit_delay_ = std::min(next_reinit_delay_ + increment, kOneHour); > Thnx for ...
6 years, 10 months ago (2014-01-28 22:21:35 UTC) #7
jsbell
https://codereview.chromium.org/137493003/diff/610001/webkit/browser/appcache/appcache_service.cc File webkit/browser/appcache/appcache_service.cc (right): https://codereview.chromium.org/137493003/diff/610001/webkit/browser/appcache/appcache_service.cc#newcode489 webkit/browser/appcache/appcache_service.cc:489: base::TimeDelta up_time = base::Time::Now() - last_reinit_time_; Ah, yes, much ...
6 years, 10 months ago (2014-01-28 22:45:47 UTC) #8
michaeln
@kinuko, could you take a look too since you're more familiar with this code than ...
6 years, 10 months ago (2014-01-28 23:30:29 UTC) #9
kinuko
lgtm with some nits https://codereview.chromium.org/137493003/diff/610001/webkit/browser/appcache/appcache_disk_cache.cc File webkit/browser/appcache/appcache_disk_cache.cc (right): https://codereview.chromium.org/137493003/diff/610001/webkit/browser/appcache/appcache_disk_cache.cc#newcode53 webkit/browser/appcache/appcache_disk_cache.cc:53: AppCacheDiskCache* owner ) nit: extra ...
6 years, 10 months ago (2014-01-29 07:40:30 UTC) #10
michaeln
https://codereview.chromium.org/137493003/diff/610001/webkit/browser/appcache/appcache_disk_cache.cc File webkit/browser/appcache/appcache_disk_cache.cc (right): https://codereview.chromium.org/137493003/diff/610001/webkit/browser/appcache/appcache_disk_cache.cc#newcode53 webkit/browser/appcache/appcache_disk_cache.cc:53: AppCacheDiskCache* owner ) On 2014/01/29 07:40:30, kinuko wrote: > ...
6 years, 10 months ago (2014-01-29 20:44:15 UTC) #11
michaeln
cq'ing and tbr'ing jam for the .gpyi change
6 years, 10 months ago (2014-01-29 22:23:05 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/michaeln@chromium.org/137493003/650001
6 years, 10 months ago (2014-01-29 22:30:19 UTC) #13
commit-bot: I haz the power
CQ bit was unchecked on CL. Ignoring.
6 years, 10 months ago (2014-01-30 03:04:07 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/michaeln@chromium.org/137493003/650001
6 years, 10 months ago (2014-01-30 03:10:49 UTC) #15
commit-bot: I haz the power
CQ bit was unchecked on CL. Ignoring.
6 years, 10 months ago (2014-01-30 16:43:18 UTC) #16
commit-bot: I haz the power
Change committed as 247967
6 years, 10 months ago (2014-01-30 16:43:19 UTC) #17
michaeln
https://codereview.chromium.org/137493003/diff/650001/webkit/browser/appcache/appcache_disk_cache_unittest.cc File webkit/browser/appcache/appcache_disk_cache_unittest.cc (right): https://codereview.chromium.org/137493003/diff/650001/webkit/browser/appcache/appcache_disk_cache_unittest.cc#newcode178 webkit/browser/appcache/appcache_disk_cache_unittest.cc:178: // Ensure the directory can be deleted at this ...
6 years, 10 months ago (2014-01-31 23:51:03 UTC) #18
michaeln
ptal, same patch modulo expectations in the one test to work for android and others
6 years, 10 months ago (2014-02-01 01:36:37 UTC) #19
kinuko
Diff between PS 13 and 14 lgtm. https://codereview.chromium.org/137493003/diff/690001/webkit/browser/appcache/appcache_disk_cache_unittest.cc File webkit/browser/appcache/appcache_disk_cache_unittest.cc (right): https://codereview.chromium.org/137493003/diff/690001/webkit/browser/appcache/appcache_disk_cache_unittest.cc#newcode140 webkit/browser/appcache/appcache_disk_cache_unittest.cc:140: // and ...
6 years, 10 months ago (2014-02-03 05:35:47 UTC) #20
kinuko
https://codereview.chromium.org/137493003/diff/690001/webkit/browser/appcache/appcache_database.cc File webkit/browser/appcache/appcache_database.cc (right): https://codereview.chromium.org/137493003/diff/690001/webkit/browser/appcache/appcache_database.cc#newcode12 webkit/browser/appcache/appcache_database.cc:12: #include "base/rand_util.h" // just for local testing, not for ...
6 years, 10 months ago (2014-02-03 05:36:50 UTC) #21
michaeln
https://codereview.chromium.org/137493003/diff/690001/webkit/browser/appcache/appcache_database.cc File webkit/browser/appcache/appcache_database.cc (right): https://codereview.chromium.org/137493003/diff/690001/webkit/browser/appcache/appcache_database.cc#newcode12 webkit/browser/appcache/appcache_database.cc:12: #include "base/rand_util.h" // just for local testing, not for ...
6 years, 10 months ago (2014-02-03 21:03:01 UTC) #22
michaeln
The CQ bit was checked by michaeln@chromium.org
6 years, 10 months ago (2014-02-03 21:07:51 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/michaeln@chromium.org/137493003/830001
6 years, 10 months ago (2014-02-03 21:09:04 UTC) #24
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-03 23:25:17 UTC) #25
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) telemetry_perf_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=255822
6 years, 10 months ago (2014-02-03 23:25:18 UTC) #26
commit-bot: I haz the power
CQ bit was unchecked on CL. Ignoring.
6 years, 10 months ago (2014-02-03 23:25:20 UTC) #27
commit-bot: I haz the power
CQ bit was unchecked on CL. Ignoring.
6 years, 10 months ago (2014-02-03 23:25:25 UTC) #28
commit-bot: I haz the power
CQ bit was unchecked on CL. Ignoring.
6 years, 10 months ago (2014-02-03 23:25:26 UTC) #29
commit-bot: I haz the power
CQ bit was unchecked on CL. Ignoring.
6 years, 10 months ago (2014-02-03 23:25:26 UTC) #30
commit-bot: I haz the power
CQ bit was unchecked on CL. Ignoring.
6 years, 10 months ago (2014-02-03 23:25:28 UTC) #31
michaeln
The CQ bit was checked by michaeln@chromium.org
6 years, 10 months ago (2014-02-04 00:14:40 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/michaeln@chromium.org/137493003/830001
6 years, 10 months ago (2014-02-04 00:19:19 UTC) #33
commit-bot: I haz the power
Change committed as 248642
6 years, 10 months ago (2014-02-04 00:58:06 UTC) #34
commit-bot: I haz the power
CQ bit was unchecked on CL. Ignoring.
6 years, 10 months ago (2014-02-04 00:58:07 UTC) #35
commit-bot: I haz the power
CQ bit was unchecked on CL. Ignoring.
6 years, 10 months ago (2014-02-04 00:58:08 UTC) #36
commit-bot: I haz the power
CQ bit was unchecked on CL. Ignoring.
6 years, 10 months ago (2014-02-04 00:58:10 UTC) #37
commit-bot: I haz the power
CQ bit was unchecked on CL. Ignoring.
6 years, 10 months ago (2014-02-04 00:58:11 UTC) #38
commit-bot: I haz the power
6 years, 10 months ago (2014-02-04 00:58:14 UTC) #39
Message was sent while issue was closed.
CQ bit was unchecked on CL. Ignoring.

Powered by Google App Engine
This is Rietveld 408576698