Try to recover from persistent localstorage commit errors by deleting the db

Desktop / Chromium - Marijn Kruisselbrink [chromium.org] - 12 July 2017 20:23 EDT

Certain errors can put leveldb in a mode where all future writes will automatically fail. If we detect such a situation (because too many consecutive commits failed) clear out the entire database and start fresh.

Existing renderers that were connected to a LevelDBWrapper already will be disconnected, resulting in localstorage in those renderers (for origins that were opened) to now be disconnected from eachother and from potential future renderers/origins. Connections to localstorage from new renderers or for new origins in existing renderers will end up going through the database, and should work normally.

Bug: 712399 Change-Id: Ie38020a33ce383fd43513d1cca22afbe7180fecf Reviewed-on: https://chromium-review.googlesource.com/533720 Commit-Queue: Marijn Kruisselbrink

b8c4af1 Try to recover from persistent localstorage commit errors by deleting the db.
.../dom_storage/local_storage_context_mojo.cc | 136 +++++---
.../dom_storage/local_storage_context_mojo.h | 27 +-
.../local_storage_context_mojo_unittest.cc | 355 ++++++++++++++++++++-
.../local_storage_cached_area_unittest.cc | 35 ++
tools/metrics/histograms/enums.xml | 1 +
tools/metrics/histograms/histograms.xml | 19 ++
6 files changed, 523 insertions(+), 50 deletions(-)

Upstream: git.chromium.org


  • Share