New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 839186 link

Starred by 13 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 774056
issue 836332



Sign in to add a comment

//sql DCHECKs on data corruption

Project Member Reported by pwnall@chromium.org, May 3 2018

Issue description

Chrome's higher-level SQLite API, implemented in //sql, aims to flag bugs early by DCHECKing on SQLite errors that are unlikely to occur during development. The thinking is that some SQLite errors are most likely to come from API misuse, such as bad SQL statements.

While reasonable, this approach goes against the principle that DCHECKs should only be used for invariant checking, and should never fail in real-world situations. For example, the same SQLite error code that generally indicates a bad SQL statement might be caused by database corruption.

We need to audit //sql and come up with a better error handling strategy. The new strategy should flag development errors as early as possible, subject to the constraint of using our logging APIs as intended.
 
Cc: brettw@chromium.org
 Issue 17994  has been merged into this issue.
 Issue 766696  has been merged into this issue.
Blocking: 774056
Blocking: 836332
Issue 836332 is related. SQLite caused test flakiness on bots due to I/O errors. That's an interesting case -- I think that the work in this bug (removing the DCHECKs) will make the I/O errors harder to debug, so it'll be a regression for that scenario.
Perhaps an opt-in command line flag to hard crash on suspected IO errors could help while still allowing removal of the bad dcheck pattern?

Sign in to add a comment