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

Issue 1434993002: [tracing] Add separate dump provider for sql connection (Closed)

Created:
5 years, 1 month ago by ssid
Modified:
4 years, 11 months ago
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@web_cache2_base
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[tracing] Add separate dump provider for sql connection The sql connection memory dump is not thread safe since the connections can get deleted while a dump is happening. To make this thread safe, this CL introduces a dump provider class owned by the connection. This class holds a lock when dumping and deleting the database. Also, to workaround thread safe dump provider registration, it uses the UnregisterAndDeleteDumpProviderAsync api added in crrev.com/1430073002. BUG=466141 Committed: https://crrev.com/3be5b1ecdf66f6eaaa0ba98f9b36cc2d93bf54d9 Cr-Commit-Position: refs/heads/master@{#369161}

Patch Set 1 #

Patch Set 2 : Nit. #

Patch Set 3 : Rebase. #

Total comments: 16

Patch Set 4 : Fixes. #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+149 lines, -55 lines) Patch
M sql/BUILD.gn View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M sql/connection.h View 1 2 7 chunks +7 lines, -8 lines 0 comments Download
M sql/connection.cc View 1 2 3 5 chunks +18 lines, -43 lines 2 comments Download
A sql/connection_memory_dump_provider.h View 1 2 3 1 chunk +41 lines, -0 lines 0 comments Download
A sql/connection_memory_dump_provider.cc View 1 2 3 1 chunk +74 lines, -0 lines 2 comments Download
M sql/connection_unittest.cc View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M sql/sql.gyp View 1 chunk +2 lines, -0 lines 0 comments Download
M sql/sql_memory_dump_provider.h View 1 2 2 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 32 (16 generated)
ssid
PTAL, Thanks.
5 years, 1 month ago (2015-11-11 17:21:51 UTC) #2
ssid
Rebased. PTAL, thanks.
4 years, 11 months ago (2016-01-07 19:18:28 UTC) #6
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1434993002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1434993002/100001
4 years, 11 months ago (2016-01-08 15:10:33 UTC) #8
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 11 months ago (2016-01-08 16:20:32 UTC) #10
Primiano Tucci (use gerrit)
LGTM with some minor comments. Thanks https://codereview.chromium.org/1434993002/diff/100001/sql/connection.cc File sql/connection.cc (right): https://codereview.chromium.org/1434993002/diff/100001/sql/connection.cc#newcode1820 sql/connection.cc:1820: memory_dump_provider_.reset( Add a ...
4 years, 11 months ago (2016-01-11 19:27:43 UTC) #11
ssid
Made suggested changes. Thanks https://codereview.chromium.org/1434993002/diff/100001/sql/connection.cc File sql/connection.cc (right): https://codereview.chromium.org/1434993002/diff/100001/sql/connection.cc#newcode1820 sql/connection.cc:1820: memory_dump_provider_.reset( On 2016/01/11 19:27:42, Primiano ...
4 years, 11 months ago (2016-01-12 12:23:08 UTC) #13
ssid
+shess This is to fix the race that can happen when connection is cleared when ...
4 years, 11 months ago (2016-01-12 12:23:50 UTC) #15
Scott Hess - ex-Googler
LGTM. Michael, in case he wants to add comments. As noted below, I think this ...
4 years, 11 months ago (2016-01-12 19:33:14 UTC) #18
Primiano Tucci (use gerrit)
https://codereview.chromium.org/1434993002/diff/140001/sql/connection.cc File sql/connection.cc (right): https://codereview.chromium.org/1434993002/diff/140001/sql/connection.cc#newcode481 sql/connection.cc:481: } On 2016/01/12 19:33:14, Scott Hess wrote: > OK, ...
4 years, 11 months ago (2016-01-12 19:38:02 UTC) #19
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1434993002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1434993002/140001
4 years, 11 months ago (2016-01-13 11:20:33 UTC) #21
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 11 months ago (2016-01-13 12:01:19 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1434993002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1434993002/140001
4 years, 11 months ago (2016-01-13 12:56:40 UTC) #26
commit-bot: I haz the power
Committed patchset #4 (id:140001)
4 years, 11 months ago (2016-01-13 14:22:06 UTC) #28
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/3be5b1ecdf66f6eaaa0ba98f9b36cc2d93bf54d9 Cr-Commit-Position: refs/heads/master@{#369161}
4 years, 11 months ago (2016-01-13 14:23:22 UTC) #30
michaeln
https://codereview.chromium.org/1434993002/diff/140001/sql/connection_memory_dump_provider.cc File sql/connection_memory_dump_provider.cc (right): https://codereview.chromium.org/1434993002/diff/140001/sql/connection_memory_dump_provider.cc#newcode44 sql/connection_memory_dump_provider.cc:44: int status = sqlite3_db_status(db_, SQLITE_DBSTATUS_CACHE_USED, &cache_size, maybe a comment ...
4 years, 11 months ago (2016-01-14 01:37:40 UTC) #31
Scott Hess - ex-Googler
4 years, 11 months ago (2016-01-21 20:30:07 UTC) #32
Message was sent while issue was closed.
https://codereview.chromium.org/1434993002/diff/140001/sql/connection_memory_...
File sql/connection_memory_dump_provider.cc (right):

https://codereview.chromium.org/1434993002/diff/140001/sql/connection_memory_...
sql/connection_memory_dump_provider.cc:44: int status = sqlite3_db_status(db_,
SQLITE_DBSTATUS_CACHE_USED, &cache_size,
On 2016/01/14 01:37:40, michaeln wrote:
> maybe a comment or check of some kind about SQLITE_THREADSAFE being turned on:
 
> DCHECK(sqlite3_threadsafe())

SQLITE_THREADSAFE is out of reach, here, but sqlite3_threadsafe() returns
whatever SQLITE_THREADSAFE is in the sqlite compile.

If you were feeling like adding a DCHECK(), though, add it at registration
rather than here, so that it actually fires early enough to matter (this code
might never run in a local build for a variety of reasons, especially if
someone's working on sqlite stuff, not on memory-tracing stuff).

[Actually, we're so dependent on SQLite being thread-safe that I don't think it
matters whether anyone checks this, but another option would be to put it in
sqlite_features_unittest.cc.]

Powered by Google App Engine
This is Rietveld 408576698