Remove isTerminating() calls from Streams code |
||||
Issue descriptionisTerminating() was added as a workaround by this change: https://chromium.googlesource.com/chromium/src/+/bef901ae9100f30e3ee2fb185c4197a2de55e4c1 Note that simply removing the function does not work. See the original report on issue 640521
,
Sep 1 2016
I suspect that a service worker is forcibly terminated by WorkerThread::ForceTerminationTask while a stream is being processed. Random ideas (MT: Main Thread, WT: Worker Thread): A) We could prolong the delay of the task to reduce the cases. Prolonging the delay may block graceful renderer process shutdown, but the shutdown sequence will be removed soon (issue 639244) and it shouldn't be a matter. B) A task may run on WT after forcible termination task runs on MT in the following scenario: 1) MT posts a long-running task (> 2 sec) to WT. 2) MT posts a normal task to WT. 3) MT requests to terminate and schedules a forcible termination task. 4) After a while, the forcible termination task runs on MT and terminates Isolate. 5) The normal task runs on MT, accesses V8 API and crashes. Probably MT should notify forcible termination of the worker thread at the step 4) or WT should check Isolate::IsExecutionTerminating() on performTaskOnWorkerThread().
,
Sep 1 2016
modules/fetch related code posts a task without using core/worker code (see https://cs.chromium.org/chromium/src/content/child/shared_memory_data_consumer_handle.cc?q=SharedMemoryData&sq=package:chromium&l=461). Hence it's hard to ignore such tasks uniformally by modifying core/worker code.
,
Sep 2 2016
We can call prepareForShutdown in didProcessTask if the forcible termination has been requested. That triggers ActiveDOMObject::stop in the worker thread.
,
Sep 5 2016
Reg: c#4, that sounds like a good idea :) (Reassigned this to yhirano@ because he has some patches)
,
Sep 6 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c71893f933af16266912649fb1543043323609b7 commit c71893f933af16266912649fb1543043323609b7 Author: yhirano <yhirano@chromium.org> Date: Tue Sep 06 00:07:10 2016 [Worker] Call contextDestroyed in shutdown preparation WorkerOrWorkletGlobalScope::notifyContextDestroyed is currently called in performShutdownTask, but it is generally good to notify that earlier. BUG= 641215 Review-Url: https://codereview.chromium.org/2305603002 Cr-Commit-Position: refs/heads/master@{#416568} [modify] https://crrev.com/c71893f933af16266912649fb1543043323609b7/third_party/WebKit/Source/core/workers/WorkerThread.cpp
,
Sep 6 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/7a2a29de535c01c40ef8ee11621064572676e61d commit 7a2a29de535c01c40ef8ee11621064572676e61d Author: yhirano <yhirano@chromium.org> Date: Tue Sep 06 06:56:36 2016 [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 Review-Url: https://codereview.chromium.org/2299883006 Cr-Commit-Position: refs/heads/master@{#416598} [modify] https://crrev.com/7a2a29de535c01c40ef8ee11621064572676e61d/third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp [modify] https://crrev.com/7a2a29de535c01c40ef8ee11621064572676e61d/third_party/WebKit/Source/core/workers/WorkerThread.cpp
,
Sep 7 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/3912603d018537e6b260ede4f67c18e3957c9143 commit 3912603d018537e6b260ede4f67c18e3957c9143 Author: yhirano <yhirano@chromium.org> Date: Wed Sep 07 07:47:41 2016 Remove isTerminating checks from fetch API + streams code BUG= 641215 Review-Url: https://codereview.chromium.org/2312413003 Cr-Commit-Position: refs/heads/master@{#416875} [modify] https://crrev.com/3912603d018537e6b260ede4f67c18e3957c9143/third_party/WebKit/Source/core/streams/ReadableStreamController.h [modify] https://crrev.com/3912603d018537e6b260ede4f67c18e3957c9143/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp [modify] https://crrev.com/3912603d018537e6b260ede4f67c18e3957c9143/third_party/WebKit/Source/modules/fetch/ReadableStreamDataConsumerHandle.cpp
,
Sep 9 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/7875b88ecfc01daa437a59dd9ff5b9fa32d15a29 commit 7875b88ecfc01daa437a59dd9ff5b9fa32d15a29 Author: yhirano <yhirano@chromium.org> Date: Fri Sep 09 04:22:37 2016 Remove isTerminating checks from ReadableStreamOperations BUG= 641215 Review-Url: https://codereview.chromium.org/2319013006 Cr-Commit-Position: refs/heads/master@{#417502} [modify] https://crrev.com/7875b88ecfc01daa437a59dd9ff5b9fa32d15a29/third_party/WebKit/Source/core/streams/ReadableStreamOperations.cpp
,
Sep 13 2016
Looks like #8 and #9 didn't cause a lot of crashes.
,
Sep 13 2016
Yay! \o/ |
||||
►
Sign in to add a comment |
||||
Comment 1 by nhiroki@chromium.org
, Aug 26 2016