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

Issue 2342523002: Forcibly clear worker ref counts on shutdown. (Closed)

Created:
4 years, 3 months ago by falken
Modified:
4 years, 3 months ago
Reviewers:
horo, jam, alokp
CC:
chromium-reviews, alemate+watch_chromium.org, creis+watch_chromium.org, achuith+watch_chromium.org, nasko+codewatch_chromium.org, darin-cc_chromium.org, blink-worker-reviews_chromium.org, oshima+watch_chromium.org, kinuko+watch, davemoore+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Forcibly clear worker ref counts on shutdown. Original patch author: horo@ at https://codereview.chromium.org/2248583003/ bug 608049 is a top crasher on stable channel. The cause is that render process hosts are not reliably destructing on shutdown because shared workers keep them alive. Shared worker bookkeeping is expected to return the worker ref counts to zero when documents close, but I suspect it often doesn't finish in time for shutdown since it requires posting tasks between the IO thread and UI thread. https://crrev.com/798a8b94726d3c439e6302998f31bc487f521ec8 tried to solve the bug by removing waiting for an IPC from the renderer process, but the thread hopping means shutdown is still racy. This patch forcibly sets the ref counts to 0 on the UI thread when the browser context is shutting down, similar to what we do for service workers. BUG=636377, 608049 Committed: https://crrev.com/04a6912a1a2b77faf61e4b2514b9ecff74ee1f21 Cr-Commit-Position: refs/heads/master@{#420728}

Patch Set 1 #

Total comments: 13

Patch Set 2 : rebase #

Patch Set 3 : comments #

Patch Set 4 : self-review #

Patch Set 5 : deps #

Patch Set 6 : fix deps #

Patch Set 7 : add back public interface #

Patch Set 8 : more bundles #

Total comments: 1

Patch Set 9 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+116 lines, -37 lines) Patch
M chrome/browser/browsing_data/browsing_data_counter_utils_unittest.cc View 1 2 3 4 5 6 7 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/browsing_data/hosted_apps_counter_unittest.cc View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/chrome_content_browser_client_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/login/quick_unlock/pin_storage_unittest.cc View 1 2 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/login/saml/saml_offline_signin_limiter_unittest.cc View 1 2 3 4 5 6 7 5 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/policy/recommendation_restorer_unittest.cc View 1 2 3 4 5 6 7 4 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/printing/printer_pref_manager_unittest.cc View 5 chunks +5 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/status/data_promo_notification_unittest.cc View 1 2 3 4 5 6 7 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/notifications/extension_welcome_notification_unittest.cc View 1 2 3 4 5 6 7 8 4 chunks +3 lines, -4 lines 0 comments Download
M chrome/browser/predictors/autocomplete_action_predictor_table_unittest.cc View 1 2 3 chunks +3 lines, -5 lines 0 comments Download
M chrome/browser/predictors/resource_prefetch_predictor_tables_unittest.cc View 1 2 3 chunks +3 lines, -6 lines 0 comments Download
M chrome/browser/renderer_context_menu/open_with_menu_factory_ash_unittest.cc View 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/safe_browsing/incident_reporting/platform_state_store_win_unittest.cc View 1 2 3 4 5 6 7 4 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/safe_browsing/incident_reporting/state_store_unittest.cc View 1 2 3 4 5 6 7 4 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/supervised_user/legacy/supervised_user_registration_utility_unittest.cc View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/ui/views/first_run_bubble_unittest.cc View 1 2 3 4 5 2 chunks +6 lines, -1 line 0 comments Download
M content/browser/browser_context.cc View 1 2 3 4 5 6 7 8 2 chunks +13 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.h View 1 2 3 4 5 6 2 chunks +6 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 5 6 7 8 5 chunks +23 lines, -2 lines 0 comments Download
M content/browser/shared_worker/shared_worker_service_impl.cc View 1 2 3 chunks +9 lines, -4 lines 0 comments Download
M content/public/browser/render_process_host.h View 1 3 4 5 6 1 chunk +10 lines, -0 lines 0 comments Download
M content/public/test/mock_render_process_host.h View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M content/public/test/mock_render_process_host.cc View 1 3 4 5 6 1 chunk +8 lines, -0 lines 0 comments Download

Messages

Total messages: 40 (25 generated)
falken
horo PTAL
4 years, 3 months ago (2016-09-14 05:43:49 UTC) #3
horo
lgtm
4 years, 3 months ago (2016-09-14 06:31:57 UTC) #6
falken
jam: Can you please review?
4 years, 3 months ago (2016-09-14 06:58:27 UTC) #10
jam
https://codereview.chromium.org/2342523002/diff/1/content/browser/browser_context.cc File content/browser/browser_context.cc (right): https://codereview.chromium.org/2342523002/diff/1/content/browser/browser_context.cc#newcode338 content/browser/browser_context.cc:338: // on the UI thread anyway, so we can't ...
4 years, 3 months ago (2016-09-14 17:10:50 UTC) #11
alokp
https://codereview.chromium.org/2342523002/diff/1/content/browser/renderer_host/render_process_host_impl.cc File content/browser/renderer_host/render_process_host_impl.cc (right): https://codereview.chromium.org/2342523002/diff/1/content/browser/renderer_host/render_process_host_impl.cc#newcode1894 content/browser/renderer_host/render_process_host_impl.cc:1894: if (worker_ref_count() != 0) { should we still prevent ...
4 years, 3 months ago (2016-09-16 04:47:53 UTC) #13
falken
Updated, PTAL. Sorry for the delay. https://codereview.chromium.org/2342523002/diff/1/content/browser/browser_context.cc File content/browser/browser_context.cc (right): https://codereview.chromium.org/2342523002/diff/1/content/browser/browser_context.cc#newcode338 content/browser/browser_context.cc:338: // on the ...
4 years, 3 months ago (2016-09-21 08:59:43 UTC) #19
falken
Actually the review can wait, I need to fix some unit tests on other platforms ...
4 years, 3 months ago (2016-09-21 14:41:45 UTC) #24
falken
Bots seem improved. PTAL. https://codereview.chromium.org/2342523002/diff/160001/chrome/browser/chromeos/login/saml/saml_offline_signin_limiter_unittest.cc File chrome/browser/chromeos/login/saml/saml_offline_signin_limiter_unittest.cc (right): https://codereview.chromium.org/2342523002/diff/160001/chrome/browser/chromeos/login/saml/saml_offline_signin_limiter_unittest.cc#newcode109 chrome/browser/chromeos/login/saml/saml_offline_signin_limiter_unittest.cc:109: base::MessageLoop::current()->SetTaskRunner(runner_); Question: Is it necessary ...
4 years, 3 months ago (2016-09-21 16:01:25 UTC) #27
falken
jam: ping
4 years, 3 months ago (2016-09-22 16:26:04 UTC) #30
jam
https://codereview.chromium.org/2342523002/diff/1/content/public/browser/render_process_host.h File content/public/browser/render_process_host.h (right): https://codereview.chromium.org/2342523002/diff/1/content/public/browser/render_process_host.h#newcode316 content/public/browser/render_process_host.h:316: virtual void ForceReleaseWorkerRefCounts() = 0; On 2016/09/21 08:59:43, falken ...
4 years, 3 months ago (2016-09-23 19:14:28 UTC) #31
jam
btw sorry for the delay, I missed this. Please try putting this on the implementation ...
4 years, 3 months ago (2016-09-23 19:15:52 UTC) #32
falken
Yep, the bad cast happened in unit tests. These tests were failing due to the ...
4 years, 3 months ago (2016-09-23 19:59:35 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2342523002/180001
4 years, 3 months ago (2016-09-23 20:00:27 UTC) #36
commit-bot: I haz the power
Committed patchset #9 (id:180001)
4 years, 3 months ago (2016-09-23 21:06:57 UTC) #38
commit-bot: I haz the power
4 years, 3 months ago (2016-09-23 21:10:57 UTC) #40
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/04a6912a1a2b77faf61e4b2514b9ecff74ee1f21
Cr-Commit-Position: refs/heads/master@{#420728}

Powered by Google App Engine
This is Rietveld 408576698