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

Issue 6209005: Fix IndexedDB race condition during shutdown. (Closed)

Created:
9 years, 11 months ago by hans
Modified:
9 years, 5 months ago
Reviewers:
bulach, jorlow, jorlow1
CC:
chromium-reviews, darin-cc_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

Fix IndexedDB race condition during shutdown. Make sure IndexedDBContext is deleted before returning from ~WebKitContext. Otherwise, UtilityProcessHost may still be in batch mode when the IO thread is shut down. BUG=67422 TEST=browser_tests --gtest_filter=IndexedDBBrowserTest.* Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=72157

Patch Set 1 #

Total comments: 4

Patch Set 2 : Fix unit_tests and address review comments #

Patch Set 3 : First stab at new approach #

Total comments: 2

Patch Set 4 : Singleton wrapper approach #

Total comments: 12

Patch Set 5 : Addressing Marcus's comments #

Total comments: 15

Patch Set 6 : Addressing Jeremy's comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+198 lines, -130 lines) Patch
M chrome/browser/in_process_webkit/browser_webkitclient_impl.h View 1 2 3 3 chunks +0 lines, -3 lines 0 comments Download
M chrome/browser/in_process_webkit/browser_webkitclient_impl.cc View 1 2 3 4 5 2 chunks +3 lines, -13 lines 0 comments Download
M chrome/browser/in_process_webkit/indexed_db_browsertest.cc View 1 2 3 3 chunks +4 lines, -9 lines 0 comments Download
M chrome/browser/in_process_webkit/indexed_db_key_utility_client.h View 1 2 3 4 5 1 chunk +22 lines, -66 lines 0 comments Download
M chrome/browser/in_process_webkit/indexed_db_key_utility_client.cc View 1 2 3 4 5 8 chunks +155 lines, -30 lines 0 comments Download
M chrome/browser/io_thread.cc View 1 2 3 4 5 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/test/data/indexeddb/object_store_test.js View 1 2 3 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/test/data/indexeddb/transaction_run_forever.js View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/test/data/indexeddb/transaction_test.js View 1 2 3 2 chunks +6 lines, -5 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
hans
9 years, 11 months ago (2011-01-12 12:57:14 UTC) #1
hans
On 2011/01/12 12:57:14, hans wrote: Looks like we break ExtensionServiceTest.KilledExtensions.. looking into that.
9 years, 11 months ago (2011-01-12 14:52:40 UTC) #2
jorlow
http://codereview.chromium.org/6209005/diff/1/chrome/browser/in_process_webkit/webkit_context.cc File chrome/browser/in_process_webkit/webkit_context.cc (right): http://codereview.chromium.org/6209005/diff/1/chrome/browser/in_process_webkit/webkit_context.cc#newcode30 chrome/browser/in_process_webkit/webkit_context.cc:30: base::WaitableEvent& event_; Why not a pointer? That seems more ...
9 years, 11 months ago (2011-01-12 17:08:21 UTC) #3
hans
On 2011/01/12 17:08:21, jorlow wrote: > http://codereview.chromium.org/6209005/diff/1/chrome/browser/in_process_webkit/webkit_context.cc > File chrome/browser/in_process_webkit/webkit_context.cc (right): > > http://codereview.chromium.org/6209005/diff/1/chrome/browser/in_process_webkit/webkit_context.cc#newcode30 > ...
9 years, 11 months ago (2011-01-13 17:05:45 UTC) #4
hans
Trying out a new approach after discussing this with Jeremy: * Scrap the WebKitClient::idbShutdown() method ...
9 years, 11 months ago (2011-01-14 16:13:44 UTC) #5
bulach
hi hans, the overall approach seems fine, just some suggestions that may make it clear. ...
9 years, 11 months ago (2011-01-14 17:55:08 UTC) #6
hans
On 2011/01/14 17:55:08, bulach wrote: > hi hans, > > the overall approach seems fine, ...
9 years, 11 months ago (2011-01-20 14:30:17 UTC) #7
bulach
LGTM a few nits / suggestions, and win bot doesn't seem too happy: http://codereview.chromium.org/6209005/diff/16001/chrome/browser/in_process_webkit/browser_webkitclient_impl.cc File ...
9 years, 11 months ago (2011-01-20 16:49:15 UTC) #8
hans
> and win bot doesn't seem too happy Forgot to provide a recent -r option. ...
9 years, 11 months ago (2011-01-20 17:24:58 UTC) #9
jorlow1
http://codereview.chromium.org/6209005/diff/24001/chrome/browser/in_process_webkit/browser_webkitclient_impl.cc File chrome/browser/in_process_webkit/browser_webkitclient_impl.cc (right): http://codereview.chromium.org/6209005/diff/24001/chrome/browser/in_process_webkit/browser_webkitclient_impl.cc#newcode163 chrome/browser/in_process_webkit/browser_webkitclient_impl.cc:163: GetInstance()->CreateIDBKeysFromSerializedValuesAndKeyPath(std_values, Isn't this what IndexedDBKeyUtilityClient::CreateIDBKeysFromSerializedValuesAndKeyPath is for? Should you ...
9 years, 11 months ago (2011-01-21 09:33:00 UTC) #10
hans
Thanks for the review! http://codereview.chromium.org/6209005/diff/24001/chrome/browser/in_process_webkit/browser_webkitclient_impl.cc File chrome/browser/in_process_webkit/browser_webkitclient_impl.cc (right): http://codereview.chromium.org/6209005/diff/24001/chrome/browser/in_process_webkit/browser_webkitclient_impl.cc#newcode163 chrome/browser/in_process_webkit/browser_webkitclient_impl.cc:163: GetInstance()->CreateIDBKeysFromSerializedValuesAndKeyPath(std_values, On 2011/01/21 09:33:00, jorlow1 ...
9 years, 11 months ago (2011-01-21 11:27:55 UTC) #11
jorlow1
http://codereview.chromium.org/6209005/diff/24001/chrome/browser/in_process_webkit/indexed_db_key_utility_client.cc File chrome/browser/in_process_webkit/indexed_db_key_utility_client.cc (right): http://codereview.chromium.org/6209005/diff/24001/chrome/browser/in_process_webkit/indexed_db_key_utility_client.cc#newcode98 chrome/browser/in_process_webkit/indexed_db_key_utility_client.cc:98: return Singleton<IndexedDBKeyUtilityClient>::get(); On 2011/01/21 11:27:55, hans wrote: > On ...
9 years, 11 months ago (2011-01-21 11:39:34 UTC) #12
hans
On 2011/01/21 11:39:34, jorlow1 wrote: > http://codereview.chromium.org/6209005/diff/24001/chrome/browser/in_process_webkit/indexed_db_key_utility_client.cc > File chrome/browser/in_process_webkit/indexed_db_key_utility_client.cc (right): > > http://codereview.chromium.org/6209005/diff/24001/chrome/browser/in_process_webkit/indexed_db_key_utility_client.cc#newcode98 > ...
9 years, 11 months ago (2011-01-21 15:11:15 UTC) #13
jorlow1
9 years, 11 months ago (2011-01-21 15:14:12 UTC) #14
GTMitL

On Fri, Jan 21, 2011 at 3:11 PM, <hans@chromium.org> wrote:

> On 2011/01/21 11:39:34, jorlow1 wrote:
>
>
>
http://codereview.chromium.org/6209005/diff/24001/chrome/browser/in_process_w...
>
>> File chrome/browser/in_process_webkit/indexed_db_key_utility_client.cc
>>
> (right):
>
>
>
>
http://codereview.chromium.org/6209005/diff/24001/chrome/browser/in_process_w...
>
>> chrome/browser/in_process_webkit/indexed_db_key_utility_client.cc:98:
>> return
>> Singleton<IndexedDBKeyUtilityClient>::get();
>> On 2011/01/21 11:27:55, hans wrote:
>> > On 2011/01/21 09:33:00, jorlow1 wrote:
>> > > What if we've been shutdown...should we allow this?
>> >
>> > Well, we need to somehow get to the instance to check is_shutdown_?
>> >
>> > I also think that it's important that we allow
>> > CreateIDBKeysFromSerializedValuesAndKeyPath to be called even after
>>
> shutdown,
>
>> in
>> > case there are outstanding tasks on the WebKit thread.
>>
>
>  If the io thread is done, the transaction will be aborted (or at least
>> should
>> be).  Returning the error condition should be fine.
>>
>
>  Can we make it static?  Would that mess up any tests?
>>
>
> We also need to check the impl_ member to see if the implementation class
> was
> ever instantiated.
>
> The separation of this into one singleton and one actual implementation
> class is
> made with the idea that even though we need to instantiate the singleton
> during
> shutdown, at least it should be as cheap as possible, and only instantiate
> the
> actual implementation class when we need it.
>
>
> http://codereview.chromium.org/6209005/
>

Powered by Google App Engine
This is Rietveld 408576698