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

Issue 16510002: Better ActivityLog error handling (Closed)

Created:
7 years, 6 months ago by felt
Modified:
7 years, 6 months ago
Reviewers:
Matt Perry
CC:
Lei Zhang
Visibility:
Public.

Description

We were seeing ActivityLog memory leaks and assorted other errors. It was due to poor handling of error conditions (not cleaning up the DB state if something goes wrong). This CL should fix that. Added every error-handling measure I could think of: 1. Moves the error handling into the ActivityDatabase class so that we can immediately (synchronously) kill the database, instead of asynchronously doing it from the ActivityLog 2. Closes the db even for non-catastrophic errors, so that we aren't just hammering away when the I/O thread has gone wonky 3. Adds checks in ActivityDatabase to see if the db is valid so that we aren't constantly continuing to try to write to a closed database 4. Removes dead code that I had superstitiously added to the activity_log_unittest to see if adding it would remove the memory leaks (it didn't) 5. Failures in Init explicitly call the error handling code, in case it isn't automatically triggered 6. Record now returns a bool, so we can stop trying to record actions if one has failed 7. In the case of unittests where everything is running on one thread anyway, ActivityLog synchronously kills the Activity Database 8. ActivityLog does cleanup on Shutdown, which happens before references start dying BUG=246825 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=205059

Patch Set 1 #

Patch Set 2 : Forgot to remove suppressions-- these trybot runs will be more meaningful #

Patch Set 3 : Added more error precautions #

Patch Set 4 : Trying to fix error callback bug #

Patch Set 5 : git cl try #

Patch Set 6 : Adding more error checking #

Patch Set 7 : Reinstated lines commented out for testing #

Patch Set 8 : Removed unnecessary call to close #

Patch Set 9 : Cleanup before review #

Total comments: 13

Patch Set 10 : Fixed nits #

Patch Set 11 : Reinstating the command line #

Unified diffs Side-by-side diffs Delta from patch set Stats (+108 lines, -196 lines) Patch
M chrome/browser/extensions/activity_log/activity_actions.h View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/activity_log/activity_database.h View 1 2 3 4 5 6 7 8 9 4 chunks +17 lines, -17 lines 0 comments Download
M chrome/browser/extensions/activity_log/activity_database.cc View 1 2 3 4 5 6 7 8 9 10 chunks +55 lines, -36 lines 0 comments Download
M chrome/browser/extensions/activity_log/activity_database_unittest.cc View 1 2 3 4 5 6 7 8 9 8 chunks +8 lines, -8 lines 0 comments Download
M chrome/browser/extensions/activity_log/activity_log.h View 1 2 3 4 5 6 7 8 2 chunks +0 lines, -6 lines 0 comments Download
M chrome/browser/extensions/activity_log/activity_log.cc View 1 2 3 4 5 6 7 8 3 chunks +4 lines, -9 lines 0 comments Download
M chrome/browser/extensions/activity_log/activity_log_unittest.cc View 1 2 3 4 5 6 8 9 10 3 chunks +0 lines, -19 lines 0 comments Download
M chrome/browser/extensions/activity_log/api_actions.h View 1 2 3 4 5 6 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/activity_log/api_actions.cc View 1 2 3 4 5 6 2 chunks +6 lines, -2 lines 0 comments Download
M chrome/browser/extensions/activity_log/blocked_actions.h View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/activity_log/blocked_actions.cc View 1 2 3 4 5 6 2 chunks +7 lines, -2 lines 0 comments Download
M chrome/browser/extensions/activity_log/dom_actions.h View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/activity_log/dom_actions.cc View 1 2 3 4 5 6 2 chunks +6 lines, -2 lines 0 comments Download
M tools/heapcheck/suppressions.txt View 1 2 3 4 5 6 1 chunk +0 lines, -40 lines 0 comments Download
M tools/valgrind/memcheck/suppressions.txt View 1 2 3 4 5 6 1 chunk +0 lines, -50 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
Lei Zhang
You should ask the people who previously reviewed you Activity{Database,Log} CLs for a review. Last ...
7 years, 6 months ago (2013-06-06 00:07:21 UTC) #1
felt_google.com
Hiya, I was trying to put mpcomplete as reviewer but the codereview site keeps putting ...
7 years, 6 months ago (2013-06-06 00:08:37 UTC) #2
felt
Hi Matt, Could you please review this? It fixes a bug in the AL that ...
7 years, 6 months ago (2013-06-06 00:13:54 UTC) #3
felt
Hi Matt, I'd forgotten to remove the suppressions before testing. The CL isn't ready to ...
7 years, 6 months ago (2013-06-06 00:50:31 UTC) #4
felt
Hi Matt, Ready for review. Could you please take a look? I made a number ...
7 years, 6 months ago (2013-06-07 14:27:47 UTC) #5
Matt Perry
Handful of nits, but LGTM overall https://codereview.chromium.org/16510002/diff/67002/chrome/browser/extensions/activity_log/activity_database.cc File chrome/browser/extensions/activity_log/activity_database.cc (right): https://codereview.chromium.org/16510002/diff/67002/chrome/browser/extensions/activity_log/activity_database.cc#newcode50 chrome/browser/extensions/activity_log/activity_database.cc:50: if (already_ran_) return; ...
7 years, 6 months ago (2013-06-07 20:58:01 UTC) #6
felt
BTW Matt-- if you have suggestions about how to handle other people's unit tests, that ...
7 years, 6 months ago (2013-06-08 00:01:48 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/felt@chromium.org/16510002/85001
7 years, 6 months ago (2013-06-08 00:16:53 UTC) #8
Matt Perry
https://codereview.chromium.org/16510002/diff/67002/chrome/browser/extensions/activity_log/activity_log.cc File chrome/browser/extensions/activity_log/activity_log.cc (right): https://codereview.chromium.org/16510002/diff/67002/chrome/browser/extensions/activity_log/activity_log.cc#newcode137 chrome/browser/extensions/activity_log/activity_log.cc:137: if (dispatch_thread_ == BrowserThread::UI) // Cleanup fast in a ...
7 years, 6 months ago (2013-06-08 00:34:17 UTC) #9
commit-bot: I haz the power
7 years, 6 months ago (2013-06-08 13:48:00 UTC) #10
Message was sent while issue was closed.
Change committed as 205059

Powered by Google App Engine
This is Rietveld 408576698