New issue
Advanced search Search tips

Issue 838901 link

Starred by 3 users

Issue metadata

Status: Started
Owner:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Trouble in SQLiteCookieStore DB may render some cookies permanently unstoreable

Project Member Reported by morlovich@chromium.org, May 2 2018

Issue description

If there is something in the SQL database SQLiteCookieStore can't read --- usually because of trouble with decryption --- it drops it on read and doesn't notify CookieMonster.  Then when this cookie gets re-added by the website, CookieMonster doesn't know there is anything stale to remove, so it just asks the backend to add it to database --- which fails uniqueness constraints, so the cookie doesn't persist.

(This came up in 787679, but needs a separate bug, since I may want to fix for it backport it).


 
Labels: -Pri-3 Pri-2
Project Member

Comment 2 by bugdroid1@chromium.org, May 2 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e47e864cd67da692189f748403b56ba962be0bd3

commit e47e864cd67da692189f748403b56ba962be0bd3
Author: Maks Orlovich <morlovich@chromium.org>
Date: Wed May 02 18:58:40 2018

SQLitePersistentCookieStore: do some cleaning up if we have unusable rows

Before this change, if we had a cookie we could not load (decryption failed,
non-canonical), the row would be simply ignored on reading --- and then when
a new cookie with the same key was written, write would fail due to violating
uniqueness constraints. The eviction of those rows would also be spotty, since
most mechanisms relied on cookies being reported to cookie monster, though
"delete domain on exit" policy would still work.

This attempts to recover by dumping the entire eTLD + 1 group, which is good
for data consistency but may be overly disruptive.

Bug: 838901
Change-Id: I72f9497a094463db8fdfa2b4d8662b18911428b3
Reviewed-on: https://chromium-review.googlesource.com/980673
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Commit-Queue: Maks Orlovich <morlovich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#555492}
[modify] https://crrev.com/e47e864cd67da692189f748403b56ba962be0bd3/net/extras/sqlite/sqlite_persistent_cookie_store.cc
[modify] https://crrev.com/e47e864cd67da692189f748403b56ba962be0bd3/net/extras/sqlite/sqlite_persistent_cookie_store_unittest.cc
[modify] https://crrev.com/e47e864cd67da692189f748403b56ba962be0bd3/tools/metrics/histograms/enums.xml

Owner: morlovich@chromium.org
Status: Started (was: Untriaged)
Hmm, well, not seeing any decrease in SQLITE_CONSTRAINT_UNIQUE or CommitProblem after this, though the data is noisy, so it's possible that something else is wrong.

LoadProblem did decrease, but the CL changes how it's reported sometimes (as it doesn't bother loading things it's going to delete anyway, it won't report problems with them), so it may be a result of that.

... Which may mean something else is wrong.

Sign in to add a comment