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

Issue 675423002: ServiceWorker: Fix data race in shutdown sequence (Closed)

Created:
6 years, 1 month ago by Kunihiko Sakamoto
Modified:
6 years, 1 month ago
Reviewers:
jamesr, horo
CC:
chromium-reviews, mkwst+moarreviews-renderer_chromium.org, darin-cc_chromium.org, jam, serviceworker-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

ServiceWorker: Fix data race in shutdown sequence EmbeddedWorkerDispatcher should be deleted after blink::shutdown(), where all worker threads join with main thread. The worker termination code needs resources owned by EmbeddedWorkerDispatcher. BUG=426332

Patch Set 1 #

Total comments: 2

Patch Set 2 : add comment #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -5 lines) Patch
M content/renderer/render_thread_impl.cc View 1 2 chunks +6 lines, -5 lines 2 comments Download

Messages

Total messages: 9 (1 generated)
Kunihiko Sakamoto
6 years, 1 month ago (2014-10-27 08:52:38 UTC) #2
horo
https://codereview.chromium.org/675423002/diff/1/content/renderer/render_thread_impl.cc File content/renderer/render_thread_impl.cc (right): https://codereview.chromium.org/675423002/diff/1/content/renderer/render_thread_impl.cc#newcode664 content/renderer/render_thread_impl.cc:664: embedded_worker_dispatcher_.reset(); Could you please write the comments about the ...
6 years, 1 month ago (2014-10-27 13:38:25 UTC) #3
Kunihiko Sakamoto
https://codereview.chromium.org/675423002/diff/1/content/renderer/render_thread_impl.cc File content/renderer/render_thread_impl.cc (right): https://codereview.chromium.org/675423002/diff/1/content/renderer/render_thread_impl.cc#newcode664 content/renderer/render_thread_impl.cc:664: embedded_worker_dispatcher_.reset(); On 2014/10/27 13:38:25, horo wrote: > Could you ...
6 years, 1 month ago (2014-10-28 01:12:27 UTC) #4
horo
lgtm
6 years, 1 month ago (2014-10-28 01:14:52 UTC) #5
jamesr
https://codereview.chromium.org/675423002/diff/20001/content/renderer/render_thread_impl.cc File content/renderer/render_thread_impl.cc (right): https://codereview.chromium.org/675423002/diff/20001/content/renderer/render_thread_impl.cc#newcode665 content/renderer/render_thread_impl.cc:665: embedded_worker_dispatcher_.reset(); will all workers be deleted and removed from ...
6 years, 1 month ago (2014-10-28 04:41:24 UTC) #6
Kunihiko Sakamoto
https://codereview.chromium.org/675423002/diff/20001/content/renderer/render_thread_impl.cc File content/renderer/render_thread_impl.cc (right): https://codereview.chromium.org/675423002/diff/20001/content/renderer/render_thread_impl.cc#newcode665 content/renderer/render_thread_impl.cc:665: embedded_worker_dispatcher_.reset(); On 2014/10/28 04:41:24, jamesr wrote: > will all ...
6 years, 1 month ago (2014-10-28 06:41:17 UTC) #7
jamesr
OK, then I don't think this'll work - destroying entries in the workers_ map will ...
6 years, 1 month ago (2014-10-28 06:44:08 UTC) #8
Kunihiko Sakamoto
6 years, 1 month ago (2014-10-30 01:55:41 UTC) #9
On 2014/10/28 06:44:08, jamesr wrote:
> OK, then I don't think this'll work - destroying entries in the workers_ map
> will invoke the destructor on blink::WebEmbeddedWorker which will call into
> blink.  Calling into blink after blink::shutdown() can crash since basic
things
> like the heap may be invalid.  Maybe you want to join the worker threads, then
> destroy all the workers_, then call blink::shutdown()?

Ah right, thank you for pointing it out.
Then we should join the worker thread in the WebEmbeddedWorker destructor.
Created a blink patch: https://codereview.chromium.org/684223004/
Closing this review. Thanks!

Powered by Google App Engine
This is Rietveld 408576698