|
|
Chromium Code Reviews|
Created:
4 years, 3 months ago by yhirano Modified:
4 years, 3 months ago Reviewers:
nhiroki CC:
chromium-reviews, blink-reviews, falken, kinuko+worker_chromium.org, blink-worker-reviews_chromium.org, horo+watch_chromium.org Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
Description[Worker] Call prepareForShutdown ASAP when terminated forcibly
When a worker is terminated forcibly (i.e., TerminateExecution
is called), it is possible that many tasks are preceding
performShutdownOnWorkerThread on the worker task queue. As the v8 context
is in an invalid state, we need to ask worker objects to stop working
before executing all the queued tasks.
BUG=641215
Committed: https://crrev.com/7a2a29de535c01c40ef8ee11621064572676e61d
Cr-Commit-Position: refs/heads/master@{#416598}
Patch Set 1 #Patch Set 2 : fix #Patch Set 3 : fix #Patch Set 4 : fix tests #
Total comments: 5
Patch Set 5 : fix #
Total comments: 2
Patch Set 6 : fix #
Depends on Patchset: Messages
Total messages: 37 (28 generated)
The CQ bit was checked by yhirano@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_compile_dbg on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_comp...)
The CQ bit was checked by yhirano@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by yhirano@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== [wip] call prepareShutdown in willProcessTask BUG= ========== to ========== [Worker] Call prepareForShutdown ASAP when terminated forcibly When a worker is terminated forcibly (i.e., TerminateExecution is called), it is possible that many tasks are preceding performShutdownOnWorkerThread on the worker task queue. As the v8 context is in an invalid state, we need to ask worker objects to stop working as soon as possible. BUG=641215 ==========
Description was changed from ========== [Worker] Call prepareForShutdown ASAP when terminated forcibly When a worker is terminated forcibly (i.e., TerminateExecution is called), it is possible that many tasks are preceding performShutdownOnWorkerThread on the worker task queue. As the v8 context is in an invalid state, we need to ask worker objects to stop working as soon as possible. BUG=641215 ========== to ========== [Worker] Call prepareForShutdown ASAP when terminated forcibly When a worker is terminated forcibly (i.e., TerminateExecution is called), it is possible that many tasks are preceding performShutdownOnWorkerThread on the worker task queue. As the v8 context is in an invalid state, we need to ask worker objects to stop working before executing all the queued tasks. BUG=641215 ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by yhirano@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
yhirano@chromium.org changed reviewers: + nhiroki@chromium.org
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
lgtm https://codereview.chromium.org/2299883006/diff/60001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp (right): https://codereview.chromium.org/2299883006/diff/60001/third_party/WebKit/Sour... third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp:258: postTaskToWorkerGlobalScope(BLINK_FROM_HERE, createCrossThreadTask(&WorkerThreadableLoaderTestHelper::clearLoader, crossThreadUnretained(this))); How about passing WaitableEvent object to clearLoader() and making it call WaitableEvent::signal()? It's used only from here. https://codereview.chromium.org/2299883006/diff/60001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/workers/WorkerThread.cpp (right): https://codereview.chromium.org/2299883006/diff/60001/third_party/WebKit/Sour... third_party/WebKit/Source/core/workers/WorkerThread.cpp:141: if (scriptController && scriptController->isExecutionTerminating()) { else if?
The CQ bit was checked by yhirano@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2299883006/diff/60001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp (right): https://codereview.chromium.org/2299883006/diff/60001/third_party/WebKit/Sour... third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp:258: postTaskToWorkerGlobalScope(BLINK_FROM_HERE, createCrossThreadTask(&WorkerThreadableLoaderTestHelper::clearLoader, crossThreadUnretained(this))); On 2016/09/05 03:26:45, nhiroki wrote: > How about passing WaitableEvent object to clearLoader() and making it call > WaitableEvent::signal()? It's used only from here. That will change clearLoader's signature in for ThreadableLoaderTestHelper and it will affect DocumentThreadableLoaderTestHelper as well. Do you think it's better than the current code? https://codereview.chromium.org/2299883006/diff/60001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/workers/WorkerThread.cpp (right): https://codereview.chromium.org/2299883006/diff/60001/third_party/WebKit/Sour... third_party/WebKit/Source/core/workers/WorkerThread.cpp:141: if (scriptController && scriptController->isExecutionTerminating()) { On 2016/09/05 03:26:45, nhiroki wrote: > else if? Done.
https://codereview.chromium.org/2299883006/diff/60001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp (right): https://codereview.chromium.org/2299883006/diff/60001/third_party/WebKit/Sour... third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp:258: postTaskToWorkerGlobalScope(BLINK_FROM_HERE, createCrossThreadTask(&WorkerThreadableLoaderTestHelper::clearLoader, crossThreadUnretained(this))); On 2016/09/06 04:29:51, yhirano wrote: > On 2016/09/05 03:26:45, nhiroki wrote: > > How about passing WaitableEvent object to clearLoader() and making it call > > WaitableEvent::signal()? It's used only from here. > > That will change clearLoader's signature in for ThreadableLoaderTestHelper and > it will affect DocumentThreadableLoaderTestHelper as well. Do you think it's > better than the current code? Ah, I missed the interface is shared with DocumentThreadableLoaderTestHelper. Then, I'm ok with keeping the code as is :) https://codereview.chromium.org/2299883006/diff/80001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp (right): https://codereview.chromium.org/2299883006/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp:334: static void signal(WaitableEvent* event) We could remove this as follows? postTaskToWorkerGlobalScope(BLINK_FROM_HERE, createCrossThreadTask(&WaitableEvent::signal, crossThreadUnretained(&event)));
The CQ bit was checked by yhirano@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2299883006/diff/80001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp (right): https://codereview.chromium.org/2299883006/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp:334: static void signal(WaitableEvent* event) On 2016/09/06 05:06:40, nhiroki wrote: > We could remove this as follows? > > postTaskToWorkerGlobalScope(BLINK_FROM_HERE, > createCrossThreadTask(&WaitableEvent::signal, crossThreadUnretained(&event))); It's a good idea, thank you!
lgtm2
The CQ bit was unchecked by yhirano@chromium.org
The CQ bit was checked by yhirano@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from nhiroki@chromium.org Link to the patchset: https://codereview.chromium.org/2299883006/#ps100001 (title: "fix")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== [Worker] Call prepareForShutdown ASAP when terminated forcibly When a worker is terminated forcibly (i.e., TerminateExecution is called), it is possible that many tasks are preceding performShutdownOnWorkerThread on the worker task queue. As the v8 context is in an invalid state, we need to ask worker objects to stop working before executing all the queued tasks. BUG=641215 ========== to ========== [Worker] Call prepareForShutdown ASAP when terminated forcibly When a worker is terminated forcibly (i.e., TerminateExecution is called), it is possible that many tasks are preceding performShutdownOnWorkerThread on the worker task queue. As the v8 context is in an invalid state, we need to ask worker objects to stop working before executing all the queued tasks. BUG=641215 ==========
Message was sent while issue was closed.
Committed patchset #6 (id:100001)
Message was sent while issue was closed.
Description was changed from ========== [Worker] Call prepareForShutdown ASAP when terminated forcibly When a worker is terminated forcibly (i.e., TerminateExecution is called), it is possible that many tasks are preceding performShutdownOnWorkerThread on the worker task queue. As the v8 context is in an invalid state, we need to ask worker objects to stop working before executing all the queued tasks. BUG=641215 ========== to ========== [Worker] Call prepareForShutdown ASAP when terminated forcibly When a worker is terminated forcibly (i.e., TerminateExecution is called), it is possible that many tasks are preceding performShutdownOnWorkerThread on the worker task queue. As the v8 context is in an invalid state, we need to ask worker objects to stop working before executing all the queued tasks. BUG=641215 Committed: https://crrev.com/7a2a29de535c01c40ef8ee11621064572676e61d Cr-Commit-Position: refs/heads/master@{#416598} ==========
Message was sent while issue was closed.
Patchset 6 (id:??) landed as https://crrev.com/7a2a29de535c01c40ef8ee11621064572676e61d Cr-Commit-Position: refs/heads/master@{#416598} |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
